Xterm: It's better than you thought (2021)
aduros.com
aduros.com
This is one thing i don't get. All that old X stuff ... A lot of it is still usable. You can run a similar setup that one might have in the late 90s or early 2000s and it's unobtrusive, fast. I've run fvwm on my workstation for a while now. Was using WindowMaker long past its prime. There's no reason not to.
But boy are there a lot of X haters.
They've been 100% rejected. Linux conferences seem to only care about things like containers and automation these days.
X is like emacs. Doing it well is hard but there's a lot of power and flexibility under that hood if you spend the rather significant effort to discover it.
Its 40th birthday is coming up. Like JavaScript, CSS and PostScript, it's an imperfect system with compromises that gets the job done.
I'm probably just going to do the talk proposals as a write-up.
The education and conference industry are driven by those deltas because that's where the lucrative jobs are
These things tend to fall in on themselves. Ten years ago for instance, large scale data stores were the rage. Everyone was rolling out petabyte solutions for megabyte problems. This went on for years before people realized it was absurd.
You're finally starting to see this in containers. It's container overload for really simple problems - like hiring earthmovers and cement mixers when your construction job is installing a bookshelf.
People want to expand their resume and use their current job as a stepping stone but they're also creating messes by using inappropriate tools.
It's an industry problem.
Each one is it's own container, with all the baggage that comes along with configuring your helm charts, managing egress, dealing with people who want to manage security with IP address references, etc. Considering how simple a lot of these things are they should be a serverless function until the point is reached where there is a strategic advantage to the overhead of managing K8s.
I would say that >50% will never reach that stage and all that it is adding is overhead of configuration, and overhead of managing the container security.
I'm sure there are others in the same league that I don't know about. Maybe I'm just getting old but I'll never understand the rush to use k8s in teams of <100 developers.
X and here is the power of allows you to run graphical windows created from another computer. Much like you can use ssh and pipewire to commect to remote hosts and send sound over the network. X allows you to send graphical windows over the network.
"Network Transparency:
X was designed to work seamlessly over a network, allowing applications (clients) running on one machine to display their GUI on another machine's screen (the server). This feature enables users to work with remote applications as if they were running locally."
Moden operating systems still dont quite have the render remote GUI operating system windows like local Applications. Yes there is server side rendering of web apps but not for whole native operating system windows.
There is beaty in the design philosophy of Xwindows.
There is a beauty to its design, but it longer fits the current model - if you are really looking for the legacy of its design, it would probably be the web — thin clients rendering based on short instructions emitted by remote computers.
This technically correct caveat, which keeps coming up, is technically correct, but IMHO misses the point. This limited form of network transparency (it's not like pixels are slowly pushed out-of-band, you're still doing that over X) is not the most suitable solution to this problem, but how fast you're pushing frames isn't the only relevant metric.
This is slow in principle but still fast enough for most local networks. But more importantly, unlike with any VNC out there:
* It takes zero time to set up. If you have SSH setup on the server, all you need to turn it into a poor man's version of VNC is to flip the X forwarding flag. There are no additional packages to install and no services to manage besides what you're probably already using (SSH).
* It doesn't introduce an additional account management layer (no vncpasswd madness, no syncing between AD and VNC accounts and dealing with the breakage that happens when that inevitably breaks, no cloud credentials). Account and key management are easy (and you're probably doing it already!). If you need to change laptops, you just change laptops and take the keys with you -- it still takes zero time to setup.
* Even though you're just slowly pushing pixels over the wire, remote applications remain manageable by the local window manager. You don't Alt-Tab between your windows and a window with all your other windows or deal with wonky attempts to use a "rootless" VNC display mode (e.g. different keyboard maps)
Pushing pixels is certainly slow but, if you're doing it over a contemporary local network, it's fast enough and in my obviously subjective experience a way better than any VNC I've used. X-based (-ish) solutions like xpra or x2go, which still mostly push pixels, slowly, are so much better it's not even funny. Not good, mind you, there hasn't been a good experience in this field in forever, but still much closer to seamlessly using local and remote applications than any cross-platform VNC around.
Windows Remote Desktop configured to use h.264 hardware encoding is light years better than any VNC or remote X Windows I've ever used. Everything looks perfect, reacts instantly at 60 fps, and doesn't use more bandwidth than streaming a movie - even if you're playing a movie.
Fullscreen it's actually like being at the other computer and it's unparalleled by any Mac or Linux built-in screen sharing.
And when h.264 hardware encoding is not available ?
It's still orders of magnitude better than X over network, in my personal experience.
I used to watch videos over RDP served from a 300MHz Pentium II with a graphics card from back when having hardware MPEG2 decoding was special. Even today using X applications from my Ryzen 1600X server on my Ryzen 3900X desktop over a direct 40G ethernet link is jankier than RDP was 20 years ago.
X's network transparency is occasionally really useful, but there are newer and better ways to solve this problem. The way it does things made sense for the world it was developed in where asking the host to maintain a framebuffer would have been a massive waste of resources, but those resources are now plentiful.
But more importantly, drawing pixels is just one part of a gui and focusing on that without considering the other parts hurts. I've been testing input devices on remote X lately: using programs on my desktop on an old laptop with a touchscreen and a drawing tablet and all kinds of other gadgets. It has different input methods than the client computer. They all just work remotely too, with full capability. Things like copy/paste and drag+drop just working between windows, regardless of where they are running, and integration with local window management is a huge benefit, you can forget these random programs actually run somewhere else. It feels like there's no barrier.
I think they have one at Madame Tussauds computer museum.
Given the dead-simple effectiveness of Hacker News UI, my major obstacle to usability is autocorrect in the face of technical argot.
So I try my best to decode the nonsense. Despite heroic fights against autocorrect, some of my well-crafted comments are risible nonsense.
"Thus in the 80s [Microsoft] DOS, Digital Equipment [Corporation (DEC)] VAX mainframes, 90s you had PCs with spinning disks running Windows..."
It 'can work' without compositing but you drop frames if there's no common base between them... or something (ie: 144 vs 60)
I wish there was an image viewer like xterm, because my usual viewer, eog, also has dbus issues frequently.
You mean like xli or xloadimage? Or something slightly more modern, like geeqie, gthumb, or mirage? Or if you want something larger, “display” from Imagemagick?
xli - doesn't support zooming with mouse wheel
xloadimage - doesn't support zooming with mouse wheel
geeqie - has UI rendering issues (not all text visible); uses dbus
gthumb - uses dbus
mirage - core dumped on me (Ubuntu 22.04 package, remote X session)
display - doesn't support zooming with mouse wheel
My images are usually too large to fit on a screen 1:1, so zooming is essential.Really minimalistic but at the same time quite powerful under the hood. All normal operations have quick vim-inspired shortcuts (and scroll to zoom) and if you want to get advanced you can trigger scripts to do some heavy-lifting.
Not for everyone but when it fits it is brilliant.
If sxiv isn't your thing and you want something minimalistic, maybe have a look at feh (don't know if it has scroll to zoom).
I also tried feh. It simply hangs when I invoke it with a png file over a remote X11 connection.
If you are starting to wonder whether there is something wrong with my setup: I can run other applications like xterm, xeyes, gimp, just fine over a remote X11 connection.
>This is one thing i don't get. All that old X stuff
No kidding, if people really read and understood the manual for xmessage(1), you will quickly see it has no competitor in what people call "modern". I use it a lot in many interactive shell scripts.
>But boy are there a lot of X haters.
yes and getting worse and worse with wayland and desktop.org, the bane of X. I use X and once I cannot use fvwm (I use that too) on Linux, I am off to a BSD.
amen. could someone show me a simple gui message popup in ventura. i am sure it exists but have not been able to locate.
There is more to computing than 80s tech, and if one's opinion is that anything after the 80s is useless, then they're blind and biased.
I loved WindowMaker too, two decades ago, but I enjoy 2023 computing in 2023. And WindowMaker is already more advanced than fvwm or twm or any other DE that pairs well with xterm (you know, those that still use X11 fontspec strings instead of a modern font stack).
Wayland is a buggy mess, but I like hardware video acceleration, resizing windows without artifacts, compositing and one day VR, you know, technology from last decade, thank you very much.
What do you use now? Most things I've seen after that generation of WMs kind of suck. Newer tiled WMs are good but that's kind of a different category.
> hardware video acceleration, resizing windows without artifacts, compositing
You can get that on X...
In fact, tiled WMs are 90s tech, I want scrollable tiling WMs, and they are niche or pretty much unknown. See PaperWM or Cardboard
https://www.ctrl.blog/entry/cardboardwm.html
Re: hardware accel on X. I have been using Linux full time since 1999, yet I keep hearing people trying to convince me whatever crap we had before Mozilla WebRender on Wayland was hardware acceleration. Having VLC use VDPAU when opening media files is not full desktop hardware acceleration.
It has taken until Wayland to be able to move and resize windows without artefacts and lag. Stuff Windows and macOS have had since 2010. Let alone accelerated rendering of web pages and YouTube.
- Tabs
- Clickable URLs
Otherwise, XTerm is solid. The source code is a bit of a nightmare.
Some people are happy with TMux but it introduces some compatibility problems (TMux itself contains a terminal emulator, and not everything works correctly in TMux), and half the point of tabs is being able to organize them how you please—if you want move a tab to a new window, you can do that.
i'll take the TUI tab with the added bonus of not losing my work when the window is closed any day.
I also like being able to copy-paste things out of terminals, and Tmux makes it a bit difficult. I know how to use the scrollback in Tmux but it’s just so much easier to use the scrollback in a GUI terminal editor.
Having been a Linux (and unix before that) user for decades now, I’ve seen people argue over vi vs emacs, KDE vs GNOME, GTK vs Qt, GPL vs BSD and so on and so forth. They make all sorts of well reasoned arguments but it almost always just boils down to personal preference at the end of the day. Yet it’s amazing how many people think that their preferences are unequivocal facts.
Also, on X, there’s things like https://tools.suckless.org/tabbed/ which can produce tabbed layouts of arbitrary applications.
Tabbed looks cool, but I don’t see any online documentation.
It is cool that the ecosystem is flexible enough to fit our basically opposite preferences.
One of the nice things about xterm is this basically never happens.
There’s a shortcut in Vim that my tmux config gets in the way of. Ctrl-a, increment a number. This is a weird shortcut to me, though, actually I’m happy tmux over-writes it!
That's 100% on me to do that deep in the code as a significant patch. I know this. Just so lazy
Which is why we invented terminfo and ncurses.
> TMux itself contains a terminal emulator, and not everything works correctly in TMux
tmux doesn't merely contain a terminal emulator. Rather, it is a terminal emulator. All terminal emulators have slight differences in behavior and tmux is no exception. But since tmux is actively developed, I haven't personally encountered any deal breaking issues.
*VT100.translations: #override \n\
<Btn3Down>: exec-formatted("xdg-open '%t'", PRIMARY)
Now double-click a link to select it, then right-click to open.Unfortunately I lost the script and am not interested in rewriting it, but maybe it gives you some ideas. You could dispatch any action you want based on patterns in the selection.
That sounds very annoying.
Some Googling indicates that on Solaris, 'ps' would default to 80 characters wide before truncating, apparently ignoring the size of the terminal. However even that apparently did not apply when piping; it would output the full line in that case.
If I understand history correctly, with the meteoric rise in popularity of our modern day terminal(the web browser) people were wanting to run more and more browsers at the same time. as the existing desktop manager state of the art(probably windows 95) was coming up short when dealing with the number of windows people wanted open the browser manufacture Netscape said fine, we will do it our self, this is where my memory gets fuzzy, I forget if it was an early firefox(phoenix anyone) the full mozilla browser or netscape proper(6 ish timeframe) that invented tabs, but they were and still are a very popular way control your many many browser windows you had open.
Really in the wrong layer however, it should be your desktop manager that provides tabs, not the application, and some do, but it is not a common thing what with the way DM tabs fight application tabs.
But now, we've come full circle. I'm using i3 and adore its tabbed windows feature. However, it's basically impossible to disable tabs in current browsers. Firefox has some extensions [0], which combined with some custom css to hide the tab bar kinda sorta work if you're ok with a janky experience. For Chrome, I haven't found anything.
[0] I use https://gitlab.com/adsum/firefox-notabs
https://invisible-island.net/xterm/manpage/xterm.html#h2-RES...
Real browser tabs I like because if something ends up becoming a new main focus, I drag it to its own window and now it becomes its own workspace with its satellites tacked onto the window as tabs. I can close/re-open them pretty fast with browser history, and it becomes very easy for me to quickly jump in/out of mental work spaces.
However, what I cannot stand are non-browser native tabs that are becoming (?) standard in most web apps. It is very restricting in my opinion and defeats the point of tabs, and instead ends up cluttering the space far too much. The big CRMs are a perfect example of this as it slows down everything so much for me as everything is trapped in a single window, it's very difficult to isolate or preserve tabs, and you lose access to the history.
Terminal on MacOS introduced tabs some time ago and the paradigm still doesn't sit right with me. More or less it's unobtrusive enough (and I enjoy that Apple at least preserves certain accessibility options while shuffling tabs around), but I just can't quite get to the same head-space with Terminal as I can with browsers, probably because CLI is much more concise by nature and has some already pretty good systems in place for multitasking from a single window.
I use tabbed layout for grouping some things in i3/sway/hyprland like chat apps. It works well but those are things I just open once and don't think about again. Terminals are opened and closed constantly and I don't want to have to think about, or fix, new window positioning. A new tab in the existing window is going to be exactly where I expect it to be and have no impact on the positioning of any other window.
Different hierarchical levels that I can use differently to organise stuff in my mental model:
- Desktops/workspaces: completely different projects.
- Windows: different tasks within a project.
- Tabs: different documents/sessions needed for a single task.
What's the point? Why not use another terminal then? It has low latency, but it's not an order of magnitude faster than any other GPU accelerated terminal, so I don't get the point of choosing a subpar product that is 10% faster.
It is [0,1]. Have you tried it? Up to individual preference, of course, but for me it does feel a lot better.
I use Black Box [1] from Flatpak because it has great design and smart copy (Ctrl-C does both copy and SIGINT depending on the context), which is more important to me than shaving a few ms latency. These days a lot of terminal work is done with `eat` from Emacs [2], which is even slower than Blackbox.
wezterm is now becoming my favorite: it's not just very fast and responsive, but it supports sixels and has many little "details" I need like ligatures, telling you when a font doesn't support some unicode character, font fallbacks to maximize unicode coverage, and a very active community that can help you with whatever may not be clear from reading the documentation alone (I'm lua-challenged lol)
As for tabs in xterm, and a few other nice defaults I recommend the config I made during my last foray with Linux on the desktop: https://github.com/csdvrx/cutexterm
Then, if you have 'libsixel-bin' installed you can run e.g. 'img2sixel hamster.jpg', and there you go, a photo is displayed in the terminal, inline with the text.
And 'mlterm' lets you adjust the text line spacing, even negatively, so you don't have to edit the fonts to get it the way you want.
You can make double and triple clicks copy different things.
Makes other cut-n-paste look unintelligent.
Abandon All Hope, Ye Who Enter HereGood pun
XTerm: It's Better Than You Thought - https://news.ycombinator.com/item?id=25732862 - Jan 2021 (152 comments)
However, it renders much more slower than kitty in this simple test:
timeout 2 find /
Since that is likely a good use case or test for performance, I don't see further use trying to make xterm usable for me. It's a good terminal, but more modern takes are faster and have more features.
Rant: One annoying feature I always disable though are those cursed hyperlinks. Terminals don't need hyperlinks.
I didn't get any difference with jumpScroll, but fastScroll makes it go further with xterm, though not as far and consistently as kitty.
So fastScroll option for xterm might improve the execution time.
https://danluu.com/term-latency/https://danluu.com/term-late...
All that said I currently use Alacritty because benchmarks are not everything and I much prefer Alacritty's font rendering (aside from missing ligature support).
https://danluu.com/term-latency/
:)
I understand the idea behind the alternate screen, but it really annoys me to have something on the screen (like a man page or editor session) and then have it gone while I'm trying to do my next thing (like type a command based on a man page).
But, I'm addicted to wezterm's keyboard-driven copy&paste and tmux+mosh-like functionality.