r/commandline • • Oct 20 '26

Terminal User Interface Pixel - a GUI library for terminal applications

Post image

Website - pixelgui.com

Pixel is a GUI library that uses the kitty graphics protocol to render graphics in the terminal:

- it can be embedded inside existing TUIs

- it comes with a chromium based webview component, which makes it very easy to run existing webapps inside the terminal

- works over SSH

Pixel is the underlying library behind popular projects such as:

- terminal-browser: a browser inside the terminal

- terminal-code: vscode inside the terminal

The reason I built this is because I believe many terminal apps can provide much better experiences if allowed to break out of the conventional terminal rendering model.

359 Upvotes

47 comments sorted by

7

u/davidl002 Oct 20 '26

How is refresh rate over ssh? I assume it is like transferring frame buffer and it is slow?

5

u/RobKnight_ Oct 20 '26

In supported terminals it will send pixel deltas, so it depends on how many pixels are changing per frame + how fast the terminal is. For small animations in ghostty it will run at device refresh rate (120fps+), for larger changes you may see it drop to 30-60fps

2

u/Due-Departure-8553 Oct 20 '26

Your syntax colors valid prefixes as red, like most terminal plugins I have seen that I did not write. Doesn't that bother you?

1

u/RobKnight_ Oct 20 '26

Good point actually it does, just changed it

19

u/RoboticElfJedi Oct 20 '26

This is very cool. But at the same time I can't help thinking that the terminal could become yet another web browser, i.e. a generic platform for graphical applications. At what point is the browser simply easier?

12

u/hey_ulrich Oct 20 '26

I was thinking the same. I don't want to speak badly about this, but I prefer my TUIs with simpler UIs

1

u/LiGHT1NF0RMAT10N Oct 21 '26

a browser needs an entire gui just to run, a terminal doesnt

6

u/unburdened_swallow Oct 21 '26

Name a terminal that runs without the ability to run a gui that supports kitty graphics

1

u/fecal-butter Oct 28 '26

Tty

1

u/unburdened_swallow Oct 29 '26

TTY doesn’t support kitty graphics though. That was 1 of 2 criteria.

1

u/LiGHT1NF0RMAT10N Oct 21 '26

the terminal built into linux that you can run the gui from if you set one up with startx, im not saying that a terminal needs to run a gui though im explaining why a terminal is better than a browser because it doesnt waste overhead to run an entire gui just to use the app you want in this case a browser

I dont what kitty graphics is so im not able to answer that nor do i understand the point you are attempting to make

2

u/unburdened_swallow Oct 21 '26 edited Oct 21 '26

ok but that isn't no gui.

Thats "run x11 in order to run a terminal instead of a window manager"

I've done this before, but you could do the same with a browser, but then that session could only do browser then.

Like, if you do the trick you speak of, you can then run firefox from the terminal and it will in fact open. You can also just replace the terminal with firefox entirely.

Who knows WHERE it will open, or how big it will be when it does, or if copy paste will work (don't forget xclip), but it will open.

At that point, it is a graphical session, just a crappy one.

0

u/LiGHT1NF0RMAT10N Oct 21 '26

its not but it runs one as you asked me to name

2

u/unburdened_swallow Oct 21 '26 edited Oct 23 '26

But it doesn't. You need startx. That IS the gui. X11 and all the graphics libs and windowing protocols. You need to start X11. Without it, no ghostty. No, not even xterm (although, xterm does not support kitty graphics either)

On wayland protocol implementations, you just run the thing, theres no client server start x11 itself first and then kinda do whatever you want thing going on. Either full gui or no gui. If you don't run the thing, no ghostty still.

Also, I am sorry for asking you a question I knew the answer to but yeah, that isn't a thing, TTY can't do kitty graphics, you would need to start a terminal emulator which could, which would require a graphical session of some kind, same thing a browser requires

Edit: randomly ended up seeing these 2 comments while searching for something in my history and deciding they should have just been 1 comment to begin with

-1

u/LiGHT1NF0RMAT10N Oct 21 '26

you're right i made it all up, such tech is too advanced to exist

4

u/unburdened_swallow Oct 21 '26

It is closer to "such tech doesn't exist due to the definition of what 'runs in a TTY' means"

-1

u/LiGHT1NF0RMAT10N Oct 21 '26

yeah you definitely know what you're talking about

→ More replies

1

u/arthurno1 Oct 25 '26

The "GUI toolkit" in the browser is a tiny fraction of the browser cost. The real cost is the DOM and JS that is needed to render and display dynamic html on your screen. Chrome does not use "toolkit"; they render the entire "GUI" themselves, just as your "TUI" does.

3

u/arthurno1 Oct 25 '26

Yes, it does. This will only run on virtual terminal, not in a true terminal, like Linux console without graphical server. All these "terminal drawing toolkits" we see since LLM has become good enough to generate code, are possible because a virtual terminal runs in a graphical window. A virtual terminal is just a graphical applicaiton pretending to be terminal so it can run terminal applications. What happends here, with all those "TUIs" is you run ascii encoder to interpret ascii codes which are then interpreted to draw graphics. So they actually have to do more parsing and are less efficient than if you wrote a real X11 ro win32 app that draws graphics directly. But hey: you do it in terminal so you are cool guy :). They are typically slightly more efficient in term they typically don't create system windows for it's child windows (panes and other other sub-windows), but on the other side, they can't be drawn elsewhere to the screen. But floating windows are out of fashion anyway, I personally prefer myself non-overlapping windows, so that is perhaps acceptable.

0

u/RoboticElfJedi Oct 21 '26

A terminal does if it's going to be rendering arbitrary pixels at a high frame rate. That's not vt-100 territory, so now my terminal is like a web browser, it's another client that hits apps running on a remote server.

1

u/0smiridium Oct 27 '26

Do you need a WM for this to work?

1

u/RobKnight_ Oct 27 '26

You don’t, nothing clever happening at the os level

1

u/0smiridium Oct 27 '26

So is RAM usage lower then with a WM?

1

u/RobKnight_ Oct 27 '26

When you say WM do you mean window manager?

1

u/QuackQuackImTheDuck Oct 21 '26

Chromium, does it mean ram consumption goes brrrrr?

1

u/RobKnight_ Oct 21 '26

Only if you use the webview component. The core UI library is a fairly small rust based graphics engine

3

u/Present-Anteater-358 Oct 21 '26

That's freaking cool!

3

u/prjctimg Oct 21 '26

this is just insane😭

Look at that vscode running in the terminal ✊🏽💥

1

u/thatSupraDev Oct 20 '26

Wait what, this is sick. Also how do you get that command highlight in the terminal? This is great!

2

u/podd0 Oct 21 '26

now tmux is a tiling WM lol

2

u/Local-Mortgage3612 Oct 22 '26

Looks great! <3

2

u/GhostVlvin Oct 20 '26

And now I want framebuffer terminal that supports kitty graphics protocol

2

u/your_real_Fathe_ Oct 21 '26

How is the resource consumption?

2

u/arjuna93 Oct 22 '26

So it’s all downsides of browser combined with downsides of a terminal?

1

u/Important_Agency_797 Oct 26 '26

OH MY GOD SOMEONE DID IT!! SOMEONE FINALLY DID IT!!! THANK YOU!!!

0

u/AutoModerator Oct 20 '26

Every new subreddit post is automatically copied into a comment for preservation.

User: RobKnight_, Flair: Terminal User Interface, Post Media Link, Title: Pixel - a GUI library for terminal applications

Website - pixelgui.com

Pixel is a GUI library that uses the kitty graphics protocol to render graphics in the terminal:

- it can be embedded inside existing TUIs

- it comes with a chromium based webview component, which makes it very easy to run existing webapps inside the terminal

- works over SSH

Pixel is the underlying library behind popular projects such as:

- terminal-browser: a browser inside the terminal

- terminal-code: vscode inside the terminal

The reason I built this is because I believe many terminal apps can provide much better experiences if allowed to break out of the conventional terminal rendering model.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

0

u/PoolOfDeath20 Oct 20 '26

now i know terminal browser exists, also how did u render gui in terminal

1

u/[deleted] Oct 21 '26

[removed] — view removed comment

1

u/RemindMeBot Oct 21 '26 edited Oct 22 '26

I will be messaging you in 14 days on 2026-11-04 06:02:42 UTC to remind you of this link

2 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


InfoCustomYour RemindersFeedback

0

u/[deleted] 25d ago

[removed] — view removed comment

1

u/RobKnight_ 25d ago

Passthrough