Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Foot – A fast, lightweight and minimalistic Wayland terminal emulator (codeberg.org/dnkl)
179 points by gjvc on Sept 23, 2023 | hide | past | favorite | 136 comments


As someone who has dabbled in terminal emulation (I was the maintainer of Console Telnet for Win32 twenty years ago), I have respect for someone who takes the time to optimize a terminal emulator by building a fast parser and being careful with screen updates.

That used to be the only way to make a graphical program fast, but these days hardware is so fast you can render an entire scene before the next screen refresh and still have cycles to spare. As long as you initiate rendering early enough, it's hard to go much faster.

I'm curious how foot compares to older fast terminal emulators such as Eterm, xterm, and rxvt. I think libvte is neat (anyone can write a terminal app now) but is it resulted in terribly slow programs like gnome terminal. Before that terminal emulators tended to be much faster -- they had to be, because hardware was so much more limited.


libvte is a big reason that GNOME Terminal tends to be faster than competing terminal emulators, including xterm and rxvt. One of VTE's tricks is that it doesn't bother painting the screen if the contents are going to be overwritten in the next frame anyway; you can scroll through megabytes of data in fractions of a second this way.

The idea that it's slow, that's new to me.


I have a 655MB file with 1.5 million lines of lorem ipsum. I timed a cat in several terminal emulators. For this simple test, gnome-terminal beat xterm a little bit but wasn't anywhere close to the rest:

  foot             0m9.410s
  alacritty        0m16.881s
  konsole          0m36.737s
  gnome-terminal   1m1.096s
  xterm            1m16.919s
Foot has an page that explains when and why it's fast, and also when it's not, compared to alacritty.

https://codeberg.org/dnkl/foot/wiki/Performance


There can be distinctly different run speeds between bulk entry dumb terminal and opcode heavy tui behavior.

https://tomscii.sig7.se/2020/12/A-totally-biased-comparison-...

And I don't really care that much but I will say that while it is a bit of a dog in the bulk display race, no one beats xterm in the keyboard latency contest.


Enabling fastScroll in xterm makes it competitive in the "bulk display race". It's disabled by default because who cares how fast a huge file can be displayed on stdout in real-world usage?


Glad this Termkit prototype work is right on track then. Generated a 655MB lorem text file and it came out at 0m8.186s.


I've heard various things about VTE over the years including:

1. They "like" xterm because i get value out of screen tearing and feeling like they can catch what is scrolling by (even though it's literally seconds slower) 2. They don't like the 40 fps cap it currently has because it predates reliable access to vertical sync information in applications. 3. They are using the GTK 4 port which draws with cairo and uploads surface data on every frame update.

The patches I put together for VTE this week (while having some down time with Covid) address a portion of that by making it render fonts/rectangles/emoji/etc on the GPU using GTK's OpenGL renderer (which I also wrote a large portion of).


Years ago, the biggest bottleneck with VTE was that it was storing the scrollback history on disk (https://bugzilla.gnome.org/show_bug.cgi?id=631685). Eventually support for an in-memory scrollback buffer was added, which improved the situation considerably.

Long dumps of output with VTE seems to be fast enough, at least with a barebones program that creates a VTE widget and doesn't do much else. But Gnome Terminal was noticeably slower than my naive program, last time I tried it. I don't know why.


xterm has a command line flag that enables the same speed hack. It's disabled by default. The major difference between xterm and the others is that xterm emulates a terminal and libvte-based emulators, Kitty, and the like are more like shitty xterm emulators. Accuracy is preferred over speed, and certainly over silly microbenchmarks like cat'ing a 655 MiB file to stdout and timing how long it takes to display.


Alacritty is wildly and obviously faster than gnome terminal in use. It's super clear when you try it out.


I think this does almost every terminal, including rxvt (with the notable exception of Linux console).


rxvt used to be my go-to terminal, but it was only fast in the era where we had actual 2D hardware. That era ended, oh, like 15 years ago? Ish? On the AMD side, Radeon GCN 1.0 (think 7970) came out 12 years ago, and that was their first card that entirely removed 2D hardware (which means all 2D ops are handled by optimized shaders; in Linux, that'd be handled by glamor); but wasn't the first gen of AMD that was in the process of removing 2D, and nvidia was about a gen behind every step on that.

Between then and now, I ended up trying every emulator. The libvte ones tended to be slow, buggy, and missing features (although, nowadays, it's sorta cleaned up its act, but not entirely). The terminal community has been able to write three emulators that make for good urxvt replacements: alacritty, wezterm, and kitty.

Foot seems like its trying to join those three, but it's lack of other-OS support (since it's focusing on being, purely, the best possible Wayland terminal) kind of holds it back (unless you're only using Linux, then obviously this doesn't apply to you).


Not just Linux, FreeBSD as well.


It’s interesting you call out GNOME Terminal, it’s always been my favorite terminal.


I don't think I've ever encountered a problem where terminal emulation would be too slow. What I do have encountered are terminal emulators that go bonkers and require some arcane configuration magic to figure out what to emulate.

GNOME terminal works and looks pleasant to boot. In fact it works so well that I almost never think of it although I use it all the time.


> I don't think I've ever encountered a problem where terminal emulation would be too slow.

You don't notice it until you get into a situation where the terminal (emulator) insists on showing you everything flying by, instead of just skipping to the end, in which situation you may be waiting a really long time. Some emulators also cannot deal with, say, 1 million lines of scrollback and searching.


That I've encountered a few times but tail or less deals with it fine.


That's fine if you know that your logs or whatever will be very long, but if you're unaware of how long it is, or just don't think about it, it's easy to get caught in a situation where you have to wait for several seconds until you can use your terminal again.

Related: this problem gets way worse over SSH. It would be nice if there was kind of SSH replacement that could just send what's currently on screen, plus some lines in each direction.


mosh? It's a replacement for interactive ssh.


It really depends on what you're doing frankly, sometimes you cannot use tail or less. Unfortunately.


Being fast is not just about hitting the deadline for 60fps or more. Ingestion performance (cat /dev/urandom), startup time and overall latency are also important factors.

There are a few terminal emulators that are fast enough that further optimization is mostly for the heck of it...

And ugh, gnome terminal. The internet explorer of terminal emulators, only used to install foot and alacritty.


Anyone has experience with Gnomes new "default" terminal console? How is it feature-wise (compatibility with different terminal emulations) and performance-wise?


zutty has an interesting article how it does it.

https://tomscii.sig7.se/2020/11/How-Zutty-works


I've been using Foot for a while now, having switched to it from Alacritty. I like it. I don't really require much from my terminal other than for it to "feel" snappy and to have some cosmetic customization, and from my own playing around, it does both well.


I tried it for a week or so on Ashai. It was super fast. However the lack of tab support ended up being a dealbreaker. Multiple instances are ok, but I prefer tabs at the top of my application.


I suppose foot works best with a tiling window manager, it's also very often the default with swaywm


Which allows you to do tabs (with wm). So it has tabs if you really need them. Also foot can be used as a server and client, which I use all the time. It allowes for instant start and less memory consumption, when you need many terminal windows open.


I've never understood the love for tabs. They stop you from seeing two terminals simultaneously. I mean, we invented windows exactly for that, didn't we?


It depends on what you want to manage your tabs. For example, a good tiling window manager will handle tabbing for you. In i3 Meta-w will swap into tabbed mode.


I use tmux (and before that, screen). Same paradigm as tabs, with a few benefits. Might work for you unless you are really set on actual tabs.


You sound like a fellow Sway user. I switched too for a bit, as it’s the new blessed terminal, but I had a couple glitches in a TUI app and switched back. Not really sure what I could have really gained by switching. They are both great.


Unfortunately there is no support for ligatures. A good programming font like fira or source code pro makes for such a quality of life improvement. At least easier on the eyes.

It seems that many terminal emulators can’t or won’t support them, because they are hard to render properly.

Sticking to wezterm for now.


Why would anyone want a feature that hides the truth from you???


In the age of Vim being a full IDE, these kinds of things only become more important.


Does anyone have a handy guide for getting rolling with (neo)vim as IDE? I’ve been using LunarVim which mostly works but has enough annoying edges that I want to roll my own config; but there is a lot of ground to cover and I’m not sure where to start.


Kickstart.nvim [1] is a good starting point. One big Lua file which gets you 90% there and shows what’s possible while making it easy to change/add stuff and getting started doing your own config.

[1]: https://github.com/nvim-lua/kickstart.nvim


Exactly what I was looking for, much appreciated!


I’ve really enjoyed AstroNvim and have used it pretty regularly for more than a year now. No major breaking upgrades, and very good support and user manual.


Vim is a not an ide. Intellij with java is worlds apart from any vim setup I've ever seen in the wild.


That’s because writing Java all but requires a giant, heavy ide. Like IntelliJ, eclipse or netbeans, and always has. Vim + lsp for basically any other sane language is good enough.


You can keep telling yourself that, it doesn't change the fact that IDEA beats any plain text editor for working with code in any language I've ever seriously tried.

It's not just Java. I used vim/neovim for about a decade on and off, and then went all in on neovim for about a year (because I honestly wanted to see what's on the other side), forcing myself to believe that lie in spite of my experience screaming the opposite the whole way, but eventually came back to IDEA because it's not “good enough” if you know both of them well.

One works with code on the AST level, understands the whole project at once, and is developed as a monolithic project (not really — IDEA is very modular and is built as separate components, but they integrate so well you don't feel it).

The other works with text in currently open files and has smart features tacked on the side through language servers of varying quality (the best of which have 10% of functionality supported by a comparable IDE). The difference in how they behave and what you can accomplish (I repeat, if you know both of them well) is considerable.

There are lots of things to criticize in JetBrains' tools (terrible performance, well known bugs go unfixed for decades), but it's not just a glorified text editor.

Also, Java does not "require a giant IDE" any more than other languages do. The language — because of its static typing and good support for reflection — lends itself to writing excellent autocompletion and refactoring tools. Same for C#, F#, Kotlin. Most other languages simply don't have them, not that they don't need them — they just generally cannot have them because of heavy reliance on runtime “magic”, or small user base, or exceedingly complicated analysis (even JetBrains “failed” here — CLion is a quite poor experience compared to Rider/IDEA), or other reasons.


All the reasons you give for idea being superior sound like Java developer problems.

Maybe I don’t need my editor to “understand the entire project” because the code I work on is modular and self contained enough that it doesn’t matter.

When I need a big refactor, tests are usually there to help.

Of course, when you are working on a code base full of AbstractAutowiredFactoryBeanFactories the yea of course you are going to need some more involved tooling, because it’s impossible for a human to read.


> Maybe I don’t need my editor to “understand the entire project”

With all due respect, I don’t think you have seen the monstrosities project can grow into over multiple years and big teams. Not everything is at the scope of, say, Foot - but even this pushes the boundaries of human understanding without tools to aid.


If a text editor is enough for some programming languages it doesn't mean that the editor is an IDE.


Just as much as going to the 10km away supermarket requires a car or public transport - you can walk if you want, but I will have already went home from shopping while you are still just started walking.


Walking is good for you.


You can do much better things in all that free time you get, but it is an analogy.


Naw, you have no free time because you live in a food desert where you can't even walk to get groceries and you're stuck in your car for everything. You're totally dependent on a giant, expensive, resource-intensive monster. It would be nice to have options, but you're locked in.

(walking is VIM, the Escalade is IntelliJ)


Like what?


> That’s because writing Java all but requires a giant, heavy ide

I used intellij as an example.

Visual studio and c++, rider and c#, goland and go are all vastly more feature rich than vim and an LSP.



I don't want to "get by" with probably the most important tool in my toolbelt, though.


Tbh, I never ventured outside of Konsole. Never felt I was missing something or was limited by performance or anything beyond what the stock Konsole offered.


I feel the same...and often, when i feel that, then maybe i'm not the target audience for said tool/app.? (Which is not bad either way, simply that as good as the tool/app. might be, its just not for me.)


Konsole is decent if you are running kde, but I'd guess majority of people don't


I'd guess the opposite. At least looking at GOL stats:

https://www.gamingonlinux.com/index.php?module=statistics&vi...

KDE is just the best overall DE today.


I try to use KDE every year or so, and I've been doing this since KDE 1.0. It consistently keeps not delivering the experience I want. They have an uncanny ability to keep inserting "jank" everywhere, making the whole experience feel almost good but not quite.

But I'll keep trying it. Perhaps they'll get there before I die of old age.


Not sure what you mean by jank, but nothing else even comes close in my experience. Gnome feels clunky in comparison with stuff like missing server side decorations and lack of adaptive sync on top of that.


I don't doubt that people like KDE, I just cannot figure out why. Something to do with usage patterns, perhaps. I never liked the Windows 95+ style UIs, perhaps that's it. Also KDE seems to be always be riddled by display bugs that I get to experience.

I use Gnome when the desktop is irrelevant, like for instance my gaming box. Sway for when I want to optimize developer experience.


For gaming adaptive sync is important in my case, so Gnome is really a no go since it takes them forever to implement it.


That makes me sad :/

Though now that you mention it, I recall running Tilix back when I used to run gnome. It’s been quite a few years.


it makes you sad that different people do things differently from you?


No, it makes me sad that I wish more people learned about how awesome kde is.


I used KDE and absolutely loathed it.

Admittedly this was fifteen years ago, but I was blown away by the developers’ inability to make any actual design decisions, instead punting literally everything to a mountain of configuration options.

Case in point, the taskbar system clock. There were no fewer than six full tabs of options to customize its behavior, including the ability to use Swatch Internet Time. Everything else bought into this philosophy too, to the point where I have to believe its users spend more time configuring it than actually doing anything useful or productive.

Hard pass.


KDE still has this mentality, though they try to somewhat sweep it under the rug. Toolbars aren't overflowing anymore... usually. But the menus and dialogs still have those hundreds of options and it definitely gives a feeling that the developers can't commit to decisions themselves.

Really, KDE just has a maximalist philosophy. Shove everything into users' faces all at once because of all possible opinion variations.

Part of why I like GNOME is that it's the exact opposite: minimalism. The options it does offer tend to be the options you actually might want to tweak, and there's not many of them. (In the GUI anyway; GNOME still has lots of options available via dconf-editor/gsettings, basically the GNOME equivalent of the Windows Registry)


A lot of the last few years of releases has been about tweaking defaults and providing a smoother experience for first time users. This is very subjective obviously, but I find KDE Ddefaults to be a lot closer to what I like, and I appreciate having all the options be built-in as opposed to having to hunt a dozen or so random gnome shell extensions to get that last 5%.

KDE 3 and 4 were a dumpster fire. Even the first release of Plasma was very rough. But I switched to KDE maybe 5 years ago and never really looked back. If your experience with KDE is from 15 years, give it a shot with an open mind. It’s pretty great imo


Kids today will never know the awesomeness and terribleness of Swatch Internet Time. I remember when they gave a bunch of money to CNN and for a brief period the time listed on articles was Swatch Internet Time.

Late 90s and early 2000s were strange.


I wish we had remote meetings, even annoucements, and other such stuff still noted in an "internet time" like that.


What’s wrong with UTC?


That aside from the tz name, it looks like regular time in a regular timezone (where you or the other person recides), so it's equally easy to confuse.

"Oh, you meant 11:00 UTC, not 11:00 Berlin time, ooops!".


Well, it's a matter of taste. But I find the latest version quite pleasant when using Krita's dark orange color scheme.

I really, really, love how much I can customise though.

I also try GNOME, Xfce, and Cinnamon every new relatively big release. And, as far as I'm concerned, really like all those projects.

I must say though, I hate how GNOME locks you in to their apps. I understand their commitment, but for instance I would appreciate if they let me choose which terminal I could launch from Nautilus.

I use KDE, but it's just a matter of preferring their development tools.


you can, with "gsettings set org.gnome.desktop.default-applications.terminal exec foot" for instance.

GNOME is just as configurable as KDE; the difference is KDE bothers to make any of these settings discoverable.


Thanks for the tip!


Konsole terminal widget is fine but the context menu is a literal mess and command line less useful than gnome, if that is possible.


Why wouldn't it? Obviously when you chose a way to do things you also believe it's the best, which is why you chose it.


I don’t think that all my choices are always the best choices for everyone.

Sometimes I don’t even think they’re the best for me, but I try anyway.


There was this comment in another submission today that is worth a read on why some terminals are faster on some tasks and not others https://news.ycombinator.com/item?id=37623669


Foot has an opt-in server mode so that if you are used to running multiple terminals at once, you can save a little memory. Great for a low-end device. Of course, if the server is closed/crashes, you lose all the client terminals which can be annoying.


Does the server ever crash? I’ve been using foot in the “normal” mode and I don’t recall it ever having crashed.


Unfortunately it tends to do so randomly (was using foot for like 3 or so years by now). And in the end you'll only ever end up saving single digits of RAM. I suggest using server mode *only* on a RAM constrained device like a SBC or a embedded device (Tablet running Linux).

PS: i am issue number 3 hueh


I use it this server-client mode for a couple of months at least, and I never experienced any crashes. Not that I see a huge difference, just it fits my workflow better. I do have many many terminal windows open at the same time, but most of them aren’t busy doing something. They are either some kind of app (e.g. ranger) or a space I usually come up to do something specific (e.g. this workspace I use for sshing that server and that workspace to do things locally).


I was very impressed with Foot on my MNT Reform, where I was having trouble getting Alacritty to work (hardware issues too difficult to overcome, and I say that as someone who was able to apply a patch to make Alacritty run on my Pinebook Pro before the mainline version supported the hardware). Foot installed and ran like a breeze, and never felt slow even with pretty minimal hardware.


A big upside of foot is it not being GPU accelerated. It works in situations were hardware support is missing.

Back when I used alacrity I kept foot installed for emergencies where I’d broken hardware acceleration.


When I used a Raspberry Pi 4 with 64bit kernel+userspace and Wayland (sway), foot was the only native terminal that didn't eat up lots of CPU. I presume some kind of OpenGL vs OpenGL ES issue.


Similar setup, I recall apart from foot wezterm was also fine.


Been using `foot` for a year plus at this point. No issues, works great, very happy!


Same here works well, but I am eyeing others for image support at some point.


So i lokked a bit more and the sixel support seems to be decently good in foot (and i need something that works in tmux) you can even play doom or videos at 30fps https://codeberg.org/dnkl/foot/issues/481


Foot has sixel[0] support. Is there more robust image support in Kitty and others?

[0] https://en.m.wikipedia.org/wiki/Sixel


This made me curious about image support in the emulator I use (iTerm2), and I learned that it has these cool utilities[0] that (inter alia) add aliases for imgcat and imgls, which are exactly what they sound like.

[0]https://iterm2.com/documentation-utilities.html


What is your workflow where you use images in the terminal?


Images in vim org notes with neoorg.


Is it some replica of org-mode? Could get it after a brief exploration, there is nothing about .org files, only .norg


They have their own format yes.


Wezterm does pretty much everything.


Use kitty. Works great for me.


> if you pronounce the foo part of foot the same way you pronounce foobar, then foot sounds a lot like the Swedish word fot

wait... foo in foobar isn't pronounced like foo in foot??


What is your native language, and if English, what dialect?

For me, the "foo" in "foobar" has the same vowel as "toot", which is different than "foot". Do "toot" and "foot" rhyme for you.

I speak American English, from Boston/New England but without a strong Boston accent.


Foo is ooo like in ooze

Foot is fuht, like good


It is. Surely it is, right?


In most English dialects, <foot> is pronounced /fʊt/, not /fut/.

I’m not aware of any specific examples where <foo> and <foot> have the same vowel.


Not in New York, at least. Foo rhymes with Blue and Flu, while Foot rhymes with Soot and Put (same vowel sound as Book, Look, Cook, etc.).


This certainly looks interesting. I've been using Kitty for a while and it works great and supports so many features. It would be nice to see how it compares to Foot in terms of speed. I'm also curios about Ghostty, the in-progress (but currently private) terminal from Mitchell Hashimoto.

https://mitchellh.com/ghostty


How do TUI software like nano or tmux that support mouse input behave under Wayland? Do mouse inputs work as they should? Has someone here who's using Wayland give it a try?

I have no idea how ncurses (I guess) interacts with the mouse through the terminal so I don't know if it relies on X11.


Well, all the terminal emulator needs for this is the cursor position inside the window, which Wayland provides. Nothing X11 specific here. Ncurses and similar just ask the terminal emulator to provide mouse click Escape codes.


Thanks for the explanation! :)


I use Wayland and haven't noticed any problems with mouse input in tmux while using the Kitty terminal.


Thanks for your answer :) !


Last opening for me was Rio terminal, faster then WezTerm.


Rio looks decent. Far fewer features than wezterm though. Although unlike foot, it does have tabs. wez also supports x11.


It's minimalistic but it supports animated gifs?


This is sixel. It’s kind of a standard and supported by a growing number of terminals, including xterm (but you need the VT-340 profile).

This is also really useful. I use it in Offpunk to display pictures when browsing the web.


I appreciate that their benchmarks are executed in a peak-optimized build. But, it leaves open the question of whether anyone actually enjoys that peak performance, because all the users install it from unoptimized distro packages.



Very cool. It must be a credit to the developer for contributing an easy-to-use PGO target.


I'm limited to choice of terminal emulator due to having a hard requirement for quake style one-keypress dropdown. Unfortunately, in pursuit of cross-platform compatibility the *critties feel like this is a desktop environment problem, and the last gen of console apps that can do this are getting a little long in the tooth and starting to break in things.


Probably any terminal emulator works fine for this, but you need compositor support so that the compositor can do the sliding down part.


I enjoy foot very much in conjunction with sway.


> I'm bad at names.

Lame excuse. Try at least.


My only complaint is that double clicking links only selects up until the //


It's a bit meh, IMO. Doesn't honour my dark theme settings. Doesn't support horizontal or vertical splitting, or even tabs. I'll stick with my very non-minimalistic Terminator.


here's a good read about terminal emulators, including speed benchmarks and discussing security aspects: https://lwn.net/Articles/749992/ https://lwn.net/Articles/751763/


Honest question: as somebody using the terminal mostly for things like ssh, screen and emacs in screen… why should i care about terminal speed?


A faster terminal feels better. It is the kind of things that are hard to point out but enough to feel the difference side by side.

I definitely noticed it when I switched from terminator to kitty.

Now the race of which one will cat a large file the fastest is a bit pointless, but it should be fast enough not to add more than a frame of latency for regular use.


Setting aside the fact that it's no fun waiting around when you accidentally cat a gigabyte log file to stdout, a more efficient terminal has two main advantages: it runs better on low-end hardware, and it uses less power to do the same job. If you have a fast computer and don't care about battery life, there's no real reason to switch.


these sort of questions are best answered by trying first-hand, not pondering.


One of the most useless replies I’ve seen in my life


... to one of the most entitled, lazy questions I've seen in a while.


stick around...


I'd love to use Wayland all the time, and we are almost there, but just so many quirks everywhere (especially with outdated Electron apps).


It really is nice once managed - it's hard to explain, but everything is very smooth. I would guess the display synchronization/mixed refresh rate support is to thank.

Some Electron-based things and Steam are the main holdouts I've noticed.

I suspect the Electron things at-large will be sorted out before Steam... they simply need to rebase while Valve has to modernize their libraries (ie: vgui)


Steam recently underwent a large GUI refresh, vgui has officially been retired.


That's just one I could name from memory - if you run 'xlsclients' you'll still see Steam isn't Wayland.

I was very hopeful that the redesign would be sufficient; it was not.

Thank you for the information, though - important to be current


It’s refreshing ti see an open source project hosted on a git other than github!


I love this terminal but it had a lot of flickering issues when I would run it on sway with nvidia drivers. Ended up just going back to xorg, I use kitty there.


needs panes like tilix




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: