Show HN: Term.everything – Run any GUI app in the terminal

github.com

1049 points by mmulet 4 days ago


I made a built-from scratch Wayland Compositor to display any GUI app* in the terminal! I think there is a lot of unexplored potential in custom Wayland compositors, a lot of really cool things you can embed existing applications into! So, I started with embedding apps into the terminal because that is the easiest input/output (output is just utf-8 and I use the great `chafa` library for that, and I just read from stdin for the input).

If you have any other ideas for cool Wayland compositors, let me know. I purposedly wrote 80% the app in Typescript to appeal to the most developers and attract cool contributions (I do all drawing with the familiar Canvas2D api, so if there is interest, I can also fork this out into a cool Terminal canvas, let me know!)

I have a blog post here about how I did it, but it’s pretty high level and non technical, so please ask if you have any questions.

[How I Did It](<https://github.com/mmulet/term.everything/blob/main/resource...>)

*technically only Wayland apps and x11 apps with Xwayland. But on Linux that’s mostly everything.

nick__m - 3 days ago

That's awesomely useless, it straddles the line between programming and art.

I am sure it was a great and fun learning experience.

Well done !

reactordev - 3 days ago

This is one of those things that pushes the boundaries to nowhere, yet everywhere at the same time whilst being incredibly awesome and something you can show off ad infinitum. Outstanding! Not sure how we’ll implement vdi now! Gives ghost in the shell a whole new meaning.

But can it run doom?

shonku - 2 days ago

Absolutely love the energy here. You really terminally outdid yourself here. Consider me officially shell-shocked.

marcodiego - 3 days ago

This is interesting, but there was something that was even more impressive many years ago: a GTK theme that rendered all decoration and widgets using text chars and a GDK backend that rendered to text. Combine both and you could run any GTK app on a terminal with legible text and a beautiful TUI.

http://zemljanka.sourceforge.net/cursed/screenshots/

tri2820 - 4 days ago

This is such a cool project. Personally, I think there are so many interesting use cases that can be built on top of Wayland, like https://github.com/udevbe/greenfield and this

wdavidw - 2 days ago

A few years back, I was deploying, operating and debugging a Hadoop cluster with Kerberos enabled behind a firewall with only the SSH port being opened. Without a web browser would have been a much more complicated task. I ended up installing the X11 client on my local macOS and the all Gnome + Firefox on one of the cluster's node. Something that is not doable with Wayland. This project work like a charm, here is a quick example on how to test it inside an Incus container (I had to install 2 additional dependencies).

  # Work with Gnome terminal but resolution is much better in something supporting images
  apt install -y kitty
  kitty
  # Create an incus container
  incus --project default launch images:ubuntu/24.04 term
  incus --project default shell term
  # Install dependencies
  apt install -y curl firefox libharfbuzz0b libfontconfig1
  curl -L -o term https://github.com/mmulet/term.everything/releases/download/0.5.1/term.everything.mmulet.com-dont_forget_to_chmod_+x_this_file
  mv term.everything.mmulet.com-dont_forget_to_chmod_+x_this_file term
  chmod u+x term
  echo '<h1>Hello</h1>' > test.html
  # Start firefox, wait for a few seconds
  ./term firefox test.html
warwren - 3 days ago

I remember the carbonyl project to run chromium in the terminal that got me really excited (https://github.com/fathyb/carbonyl) but it eventually became unmaintained.

This is pretty much that but supercharged. Definitely really cool to see. Good work!

serbuvlad - 3 days ago

We got Wayland over vt100 escape codes over ssh over tcp before we got a headless Wayland VNC/RDP solution.

roughly - 2 days ago

This is the exact kind of unhinged that belongs on HN. Naturally, it's written in typescript.

fzorb - 3 days ago

I remember seeing something similar named Carbonyl a while back. What a coincidence lol.

https://github.com/fathyb/carbonyl

P.S. This is very cool btw.

taviso - 2 days ago

It's fun, but reminds me of a trick using Xvfb.

For example...

    $ Xvfb :7 &
    [1] 21688
    $ xeyes -display :7 &
    [2] 21697
    $ xwd -display :7 -name xeyes -out /dev/stdout | convert xwd:- sixel:-

It looks like this: https://imgur.com/a/Eq2ToVO

Obviously no input though, you would have to use xdotool! The main benefit is that you probably already have all these tools installed :)

SJC_Hacker - 2 days ago

This could be useful for testing UI elements of apps ...

Modern UI applications are way too tightly coupled for my liking, and difficult to test especially if you don't practice "separation of concerns", e.g. decoupling the app logic from its presentation.

Haven't looked at the full thing but something like this might allow you to write tests for UI apps without actually having the UI backend...

- a day ago
[deleted]
Forgret - 4 days ago

I wish you success in further development, don't stop!

tracker1 - 3 days ago

This is pretty cool, I can see this being useful when I need to run a one-off remotely. Not sure about attaching a running program then detaching again, or mirroring... I wouldn't mind being able to SSH to my desktop and manipulate say the running Discord client, or similar.

Another similar thing that I'd been meaning to look into is the RDP remote apps stuff.

kposehn - 3 days ago

Wow. I love this! I actually have a specific, esoteric use for this: VSCode on iPad

Hopefully supports iPadOS one day.

Guestmodinfo - 2 days ago

I like it. I always want to run things in a terminal. Because 1. I used to think that's more secure than X 2. I always seem to get better audio of the videos that I run in tty and my mouse is much smoother in the tty. Yes I can move mouse in tty.

Also someone mentioned a cool project like carbonyl. They also mentioned brow.sh which I have heard but they described it in detail so that's another plus when term.everything kind of projects come they drag other cool projects to he foreground

Point 1 of mine may be pure superstition.

How term.everything works on tty I don't know maybe it will be horriblebecause of the resolution thing but still it's a nice direction.

nxobject - 2 days ago

Surprisingly enough, my keyboard is missing the "V", "N", and "C" keys. Thank you for helping me save money by not buying a new keyboard!

camdroidw - 2 days ago

Going to be a repetitive asshole but guys please remember lesson 1 of marketing for engineers: learn to post videos/screenshot first thing.

Also, I'm lost for words, this is plain awesome.

IshKebab - 3 days ago

I started working on this with the Kitty image protocol, but unfortunately that protocol is really unsuited to this sort of thing. Performance will be awful.

The protocol is sort of:

1. I'd like you to display this PNG. Here's the data: ...

2. Ok I've got the data.

3. Ok now display it at this position.

4. Ok now remove it from the screen.

We're talking motion-PNG here. Just think about how awful that is.

I wish someone would add some kind of AV1-over-terminal protocol. That would be actually useful.

The other thing I was going to try was a custom GUI that used normal terminal text for the text of widgets, but Kitty images for the rest. It's quite a hard problem though.

ugh123 - 3 days ago

This could be used on build machines I own where I occasionally need to interact with the desktop and/or browser on the machine and vnc or other desktop sharing is impractical or exposes security issues.

quotemstr - 3 days ago

Great job! If you tug on this thread long and hard enough, you develop this enough and you get RDP (which you can try via xrdp, GNOME's remoting thing, etc.).

The reason the terminal ecosystem doesn't get much more sophisticated over time isn't just the herd-of-cats fragmentation, but also evaporative cooling: people who do really cool things with terminal come to realize that what they really want is remote desktop (perhaps rootless) and leave terminal stuff as-is while they invest in more sophisticated systems instead.

user3939382 - 2 days ago

I've been working on the same thing but with a totally different approach. Good work! Keep it up.

nixpulvis - 3 days ago

This is one of those things I'm going to keep in my back pocket for a very specific time I need it for a weird reason.

I love it.

beckthompson - 3 days ago

Super cool! I also really am glad you added videos and examples in your github repo its nice to get an overview

- 4 days ago
[deleted]
babypuncher - 3 days ago

Combine this with desktop-tui[1] and say goodbye to graphical desktop managers forever!

1: https://github.com/Julien-cpsn/desktop-tui

christophilus - 3 days ago

Wow. This is amazing. I have started running a lot of stuff in containers by default for a whole host of reasons, and this may make my workflow even better on the occasions when I want to run a graphical app.

komali2 - 3 days ago

This is an incredibly cool project and you should be proud for building it.

impoppy - 3 days ago

Can it run Doom?

lazyfanatic42 - 3 days ago

It is funny but this is what I wished things did when I first started using Linux back in the day. '98-'99 timeframe, then I "learned" better that there was Xorg/X11,etc.

xiphias2 - 3 days ago

- Can you run a compositor inside a compositor? I'd love to just ssh to a server and run hyprland

- doesTerm.everything run inside tmux with automatic window resizing? I guess not, but it would be cool

chaps - 3 days ago

Neat! I did a similar project many years ago just to see if I could with ANSI color stuff to animate video in my terminal. Worked really well, but it looked like absolute butt (unlike this project).

Nicely done!

maxglute - 3 days ago

Stupid, love it. Occasionally I'll use shaderglass ascii shader on oled screen to play videos with pixel ratio that makes UI unreadable, but it's charming experience.

tclover - 2 days ago

I tried recently once again to ditch Windows for Linux. Everything kinda worked, but the MediaTek Wi-Fi drivers were janky and my speed was like 10x slower than it should’ve been. After spending about 10 hours messing around with configs, I realized I was doing literally everything except what I actually wanted to do when I turned on the PC… so I just went back and installed LTSC Windows again.

mathfailure - 2 days ago

Does running something via Term.everything consume more or less resources, than running that something directly?

watersb - 3 days ago

I love this.

I would go for weeks just in a large framebuffer terminal, no GUI running. And I still run some servers that way.

Terminally insanely great!

- 3 days ago
[deleted]
alkh - 3 days ago

This is so cool, thanks for sharing! Having this on a Mac would be great but I understand that this might be a huge undertaking :)

teknopaul - 3 days ago

Someone needs to make bash_completion really trivial to write.

It isn't: and even copy paste is hard. Clever people write apps that are bash_completion friendly.

If first main arg is bash friendly

mycli myfunc ...

Myour whole cliapp becomes "discoverable" with one tab keystroke that you probably already typed hopefully anyway.

Never need to advertise a new feature.

Deprecate by removing from completion without breaking scripts.

Then _everything_ already is in your cli, because someone already did it.

NewUser49 - 3 days ago

Outstanding project! Keep it up. If it ever gets renamed, consider - Terminal.All, T.All, or TAll.

maurya_anand - 2 days ago

Absolute madlad!! Kudos!

xarope - 3 days ago

one is required to ask about Gwerm, and why he is not moving... :-P

Koshkin - 3 days ago

> in the terminal

A note to myself: this won't work in the text mode.

didip - 3 days ago

I was about to asked about X11, but ended up learning about Wayland.

Thanks for sharing!

rc_kas - 2 days ago

WHAT THE FUACK!? You internet people are genius sometimes

riddley - 3 days ago

Do I need to be using wayland to try this? I'm still on x11.

lxe - 3 days ago

This is absolutely unhinged and I love everything about it

- 3 days ago
[deleted]
OhMeadhbh - 3 days ago

This will be very useful when it exits beta.

pancsta - 3 days ago

Another custom wayland compositor, this one not written in a scripting language.

https://github.com/wayland-transpositor/wprs

igorhvr - 2 days ago

This is so cool - thank you! I have a very (ahem) useful purpose for this: I use a command line application that calls back to a browser during authentication and that alone prevented me from doing what I needed/wanted from an ssh terminal... I will now happily laugh my ass off as it launches firefox from inside my terminal every time I use it.

rochak - 3 days ago

Wow this is incredible

QuiCasseRien - 3 days ago

insane ! but i still wonder for the use case ^^

0points - 2 days ago

Love it!

howyesno - 3 days ago

"I feel like every single day I hear about another terminal file viewer. I say, stop making terminal file viewers because you can just use the file viewer you already have! In your terminal!" LMAO

sreenathmenon - 3 days ago

Love it :)

dartharva - 3 days ago

Love it!

- 3 days ago
[deleted]
jrcii - 2 days ago

[dead]

dcreater - 3 days ago

[flagged]

- 4 days ago
[deleted]
20after4 - 3 days ago

You could use a terminal graphics protocol to render real graphics. But there is already waypipe¹ to do that kind of remoting. Without using an actual terminal.

1. https://gitlab.freedesktop.org/mstoeckl/waypipe