Top
Best
New

Posted by tosh 22 hours ago

Terminals should generate the 256-color palette(gist.github.com)
461 points | 182 commentspage 4
anthk 14 hours ago|
Harsh truth for Unix:

- A shell is not a terminal.

- Rc it's simpler than sh.

- You can totally put shells under graphical windows as in 9front

- You can do a better Unix than Unix itself while ditching out for good the VT220 interface

- Serial terminals aren't a thing under rio(9)

wang_li 12 hours ago|
That's hardly a harsh truth. We use the terminal model because it works good enough and there are decades of software that rely on it. There are certainly other models that could work, but so far they haven't been adopted. I'd love Mathematica style notebooks for my shell work.
anthk 9 hours ago||
Again, don't confuse the shell (command line interpreter) with a terminal with escape codes and the like. Check how 9font does it, you get the rc shell and a few more languages with a REPL (lua ports and the like) inside a graphical window, not by emulating a VT220 terminal running the shell inside. You can freely resize the 9front's rio window manager's windows running rc (or anything else, even games, graphical browsers, images, video players...), copy, paste, cut the text, save the history, grep the contents of a window's text itself and tons more.
wang_li 6 hours ago||
You are confusing the unix terminal model with specific terminals. The TTY concept doesn't mandate an 80x24 text only device. Outside of applications that specifically rely upon the existence of a directly addressable grid of characters, Unix TTYs and PTYs would work perfectly fine in a mathematica notebook style interface.
iamgrootali 16 hours ago||
[flagged]
delaminator 20 hours ago||
Terminals should not exist, emulating a serial teletype emulating a Hollerith machine
anthk 17 hours ago|
That's 9front/Plan9. No actual terminals, but windows with shells.
delaminator 13 hours ago||
As you can see from the down votes, people love emulating Hollerith machines. They've probably never tried writing a terminal emulator.
xvilka 12 hours ago||
As a text interface lover and someone who dived deep into terminal quirks, I do think you have a valid point. We need to design a text interface without all the legacy cruft, better suited for modern needs (including colors), and better mixed-mode output and interaction, something similar to what we have with Jupyter, for example (without the Web/JS/Python baggage though). It would require rebuilding whole ecosystem from scratch though, thus unlikely to happen any time soon.
wredcoll 12 hours ago|||
Oh hey, if only html was text based.

Oh, wait, it is.

I'm rapidly developing grumpy old man habits about this gulf between "web" and "terminal". Imagine a world where we do `ls | grep .files.size` or something.

I mean, I get why we're here, but it feels so close to giving us all the power of html/css/etc while also having pipes and shells.

skydhash 9 hours ago|||
Terminal emulators are user facing. Most programs don’t care about the terminal and have no awareness of it. They communicate through streams of texts and that’s it. I use Emacs and it’s another text interface different from the standard terminal. Think dired, proced, magit…
stackghost 21 hours ago||
It's perennially baffling to me why we're still clinging to VT220/xterm compatible terminals. I even see people claiming they prefer working in the terminal, though it's not clear to me what type of work those people are doing.

Give me a proper graphical application any day, but I recognize that it's historically been a lot more work to produce a GUI in the pre-LLM era.

But golly gee whizz if we're going to keep the command line around, can we move on from 1983?

vanviegen 20 hours ago||
GUI apps are good for discoverability. They generally are not optimized for rapid use by power users though. That's of course not an inherent limitation of GUI apps, it's just that dominant paradigms hardly seem to consider power users.

I'm still annoyed and baffled by the fact that Ubuntu had searchable application menus 10 years ago, which were awesome and worked for just about any program, and then dropped them when they abandoned Unity. And neither KDE not Gnome thought to bring them back. In stead, many apps have since dropped application menus entirely, in favour of... some mishmash of icons and ad hoc menu buttons?

Also, even in the post-LLM era, building a decent GUI app is a lot more work than building a decent terminal app.

robinsonb5 19 hours ago||
Another factor is the lack of a good cross-platform GUI toolkit (by which I mean one that (a) doesn't feel out-of-place and jarring on any platform and (b) doesn't turn a 50K app into a 1GB download.)

Between that and the level of complexity of modern GUI toolkits - and the size of their dependency trees - distribution of a GUI app is a much bigger headache than distributing a terminal app.

iberator 18 hours ago|||
there is TCL-TK. :)

Super easy to use, fast, almost zero ram usage and battle tested for 2 decades.

robinsonb5 18 hours ago||
"Equally jarring and out-of-place on all platforms" isn't quite what I asked for, but I guess it's the next best thing! ;)
ux266478 14 hours ago||
That hasn't been true for a while, it's easily the best of the bunch at this point. It's also always been trivial to change, which can't be said of the others.
NoGravitas 9 hours ago||
I'd say it's easily the least bad of the bunch, anyway, if you're really committed to cross-platform.
skydhash 14 hours ago|||
Make the core feature of your app a library, then write different interfaces according to the targeted platforms.
tezza 19 hours ago|||
Terminals are text. Text adds features missing from gui namely:

* Ad Hoc

requirements change and terminal gives ultimate empty workbench flexibility. awesome for tasks you never new you had until that moment.

* Precision

run precisely what you want, when you want it. you are not constrained by gui UX limits.

* Pipeline

cat file.txt | perl/awk/sed/jq | tee output.result

* Equal Status

everything is text so you can combine clipboard, files, netcat output, curl output and then you can transform (above) and save. whatever you like in whatever form you like, named whatever you like.

anthk 16 hours ago||
Unix is not about a terminal, that the obsolete medium, kinda like preaching about DOS PC with 386's... and CGA video cards.

9front copes with actual text throwing the terminal as a different tool to run legacy stuff in such as SSH or some small ANSI C tools either with the APE compat layer or NPE binding ANSI C code to Plan9 native functins.

You can resize windows with shells under 9front freely, no more SIGWINCH. No more broken cuts and pastes while running a terminal multiplexer. No control code risks executing potential malware.

wredcoll 12 hours ago||
Sure, I get the theory, so why doesn't exist? Where's my modern text/command based interface?
anthk 9 hours ago||
In 9front, a decades old fork of Plan9. It's basically more Unix than Unix itself, by expanding the 'everything it's a file motto' and now for real and leaving out useless VT220 emulators (and any TTY/serial emulating connections) for legacy stuff such as the 'vt' emulator itself running under a graphical window and, for instance, when running SSH against Unix machines sending you a PTY plus a shell.
consp 20 hours ago|||
Why? There is huge compatibility layer build on top of this and changing even these minor things will break stuff in places you do not expect. Want a fancy terminal? Install another one. By default most allow changing to many terminal formats. Break things to move forward is fun when it's not your problem to solve down the line.
eigenspace 18 hours ago|||
Personally, I find a REPL-based programming interface to be the most flexible and powerful way to interact with code.

My typical interface is that I have an editor open where I write package code, and then I have a julia REPL open beside it where I load the package (or includet the script or testset). Any changes I make with my editor to functions or structs in the package / script / testset are automatically reflected in my running julia session via Revise.jl.

I then execute the functions interactively from the REPL, introspect into data or generated code, debug, run benchmarks etc all from the REPL.

GUIs are great for many things, but they lack the flexibility I need for my day to day work.

hnlmorg 19 hours ago|||
Graphical applications are great if your workflow mirrors the workflow that the GUI was designed for. However if your workflow differs then you’ll often be fighting the GUI.

Think of it like different types of programming languages. Some are more suited on different types of problems than others.

For me, my workflow is about composing and gluing different processes together rather than using a standard defined tool repeatedly in the same way as that tools UI was originally designed. So the CLI is ideally suited for me in all the areas where a GUI would be high friction.

mr_toad 18 hours ago||
> it's not clear to me what type of work those people are doing.

As little as possible. Anything that can be done in a terminal can be scripted and automated, put under version control, and deployed using modern CI/CD and devops tools.

ale42 18 hours ago||
> Anything that can be done in a terminal can be scripted and automated

Sure, next time I'll need to quickly edit a configuration file I'll setup a complete CI/CD pipeline to run vim (or nano, or whatever) inside it.

pferde 15 hours ago||
Calm down, they wrote "can", not "should".
amelius 19 hours ago||
Terminals should be able to show images, so you could run Jupyter notebooks in them.
Maxious 19 hours ago||
Terminals can show images https://sw.kovidgoyal.net/kitty/graphics-protocol/
amelius 19 hours ago|||
Ok, maybe I should have said "framebuffers" instead of images.

Because that Kitty protocol seems limited in that interaction was not one of their goals.

poly2it 17 hours ago|||
First example on the Kitty image protocol sent above looks pretty interactive:

https://github.com/chase/awrit

ux266478 13 hours ago|||
What's the point? If you want a framebuffer, ask the windowing system for one. Why go through a terminal emulator?
amelius 8 hours ago||
Because this one works through screen/tmux, and works over ssh without messing with DISPLAY variables and such.
aragilar 17 hours ago||
Sixel and ReGIS have been around for decades.
flomo 20 hours ago||
If any end users actually cared about terminal/TUI apps, there would be modern APIs for whatever they want.

Since this is really just a legacy system operator monk / retrocool interface, they spend years debating ancient DEC theology.

gjvc 19 hours ago|
It's a shame to see you get downvoted (presumably because you don't cite any evidence for your assertions). As a counter-point, I will give the oft-quoted-by-me 1990s promotional video of the use of IBM CallPath on an AS/400 which should get you all misty-eyed https://youtu.be/5pY6Xxptp9A?t=2058

Enjoy.

pjmlp 19 hours ago|
This is a limitation of UNIX terminals, in other platforms not tied to a no longer existing tty interface, this isn't an issue.

Unfortunely, given that we are stuck with UNIX derived OSes, this is indeed a possible issue.

However I would argue, for fancy stuff there is the GUI right there.

comboy 19 hours ago||
I don't know any GUI that beats tmux work portability.

Of course everything depends on exact nature of the work, but personally I would gladly leave text based interfaces behind, it's just that there's nothing better.

pjmlp 16 hours ago|||
I know UNIX since being introduced to it via Xenix in 1992 thereabouts, and never found a use for tmux.

More so, I use the terminal as strictly necessary and nothing more.

wredcoll 12 hours ago||
I don't want "a terminal", I want a command based interface combined with being able to use the same set of tools/commands on all the files I interact with.

Like, it gets taken for granted, but being able to literally grep my html file, my program source and my readme file, instead of having to open a separate gui program and using its bespoke seach menu feature, is really, really nice.

There are downsides of course, like the way we keep jamming everything into the square hole that is 1980s terminal emulators and character based displays, but frequently this is worth it.

pjmlp 11 hours ago|||
Thankfully Xerox PARC has an answer for that across Smalltalk, Interlisp-D, XDE, and Cedar, and copied to certain extent in modern programming languages, REPL environments and notebooks.

Augmented nowadays with agent environments and tools in IDEs, which can even be voice controlled.

anthk 9 hours ago|||
9front does that without emulating a terminal. Grep, cc, awk, walk (no find and magical incantations with -print0 there), functions instead of aliases on rc, better lists () in rc, and so on. And you can launch these command inside your graphical editor such as sam or better, Acme. And even as a pipe to selections.
wredcoll 8 hours ago||
Ok, I'll bite: how? What's the secret sauce? And can I use it with some random perl program I downloaded that prints horoscopes?
anthk 17 hours ago|||
9front/plan9 leaves tmux and the like as toys. The moment you can use system tools, 9p and files on everything (even the text of the editor itself) you wont be back to these unusable teletype emulators, be XTerm clones or terminal multiplexors.
anthk 17 hours ago||
Unix downvoters should have a look on 9front (the most featureful/supported plan9 fork out there) in order to realize that you can follow the Unix philosophy (even more than OpenBSD itself) tossing the VT100 emulators to the legacy 'vt' emulator if you want somehow use ancient software (or SSH) while setting actual graphical windows with the shell running inside with no terminals at all. No more damn control codes messing up everything. No more linebreaks. You can cut down your text with the mouse from day one. Even under Sam, which is something like a graphical Ed crossed with Notepad and much more powerful expressions than Ex/Vi ones.
cbm-vic-20 12 hours ago|||
The 9front web site is certainly.. something.

https://9front.org

networked 12 hours ago|||
(I didn't downvote you.) Plan 9 made some really cool design decisions, and I keep looking for places to use 9P. I also believe that Plan 9, as an artifact of its era, bet too heavily on the mouse and pixel-mapped graphics. Text, character-cell terminal emulation, and SSH won for good reasons. "GUI > terminal" is a separate matter from "Plan 9 > Unix".

In some important ways, even text with hacky escape codes is more useful and more robust than a fundamentally graphical interface. Text scales up and down with display size and pixel density. Text works over high-latency links and enables simple latency compensation like in Mosh. Text gives you universal copy-paste. Text is more accessible for humans and for machines.

I use a virtual terminal daily on my phone. If we literally used rio GUIs designed around the three-button mouse and desktop pixel density, it would be a lot less ergonomic. I'd like to see a successor to the VT220 lineage, but it's easier to imagine it built on text.

pjmlp 11 hours ago|||
> I also believe that Plan 9, as an artifact of its era, bet too heavily on the mouse and pixel-mapped graphics. Text, character-cell terminal emulation, and SSH won for good reasons. "GUI > terminal" is a separate matter from "Plan 9 > Unix".

What era? That is exactly the workflow of everyone using macOS and Windows around here.

Connecting to cloud environemnts is also done via a mix of RDP, VNC, Web GUI based tooling, akin to a modern X Windows replacement.

networked 9 hours ago|||
Classic Xerox PARC-derived GUIs are very useful but not a replacement for the terminal. I also connect to my workstation over RDP, then use a terminal emulator.

Windows is a good example of what I mean. Windows system administration has become unmistakably more text- and console-centric over time with the rise of PowerShell. Windows has started shipping an SSH service and made its graphical interface optional on the server.

The web has avoided falling into the same trap. Web UIs are, for the most part, delivered to the user as hypertext rather than rio-style pixels. They rarely hard-require a mouse and have adapted well to touchscreens. Graphics in new web UIs is usually vector (SVG).

pjmlp 8 hours ago||
You are missing the part that PowerShell has exactly a Xerox PARC like experience, first with PowerShell Integrated Scripting Environment, nowadays the same experience is available in VSCode.

Replicating the experience of using something like Smalltalk transcript window.

Of course Windows has SSH support, it needs to interoperate with UNIX, given that UNIX won the server room.

No need for SSH to talk with Windows Core/Nano, it can be done via Web GUI administration, or PowerShell remoting.

networked 7 hours ago|||
> Replicating the experience of using something like Smalltalk transcript window.

As far as I know from Pharo, the Smalltalk transcript logs plain text and is less capable than xterm. So what you care about is not the capabilities of the terminal but having a long-lived interactive session/REPL or a REPL integrated with an editor?

> No need for SSH to talk with Windows Core/Nano, it can be done via Web GUI administration, or PowerShell remoting.

I was thinking of the administrator connecting to Windows from their Mac or Linux/BSD machine. I don't know if that's a good idea compared to them getting a Windows VM and using Windows-to-Windows PowerShell remoting as you suggest.

anthk 9 hours ago|||
With 9front you don't use SSH except against Unix. The motho there is too use 9p and import remote 'cpus', devices, auth against different servers... total orthogonality. You can spawn remote windows as if they were local. Heck, you can debug remote processes as if they were local too. By comparison SSH looks primitive...
anthk 9 hours ago|||
No, it's the opposite. in order to send commands to a hosts you shouldn't need a terminal emulator (twice or thrice, depending on the SSH, tmux and the VTY subsystem under Unix) and even sending baud information. 9front just gives you the graphical window and the shell. Mosh? Ok, 9p and more can be almost stateless in order to not drop the connections. Still, you aren't bound to neither escape codes nor to crude hacks as SINWINCH and horrors to copy and paste text under Tmux/Screen. Don't get me started on trying to do such tasks with URL's.

Text? I do that under 9front, too. Heck, rc it's simpler there than sh itself. I can bind remote machines and use their scripts as if they were my own. I can import remote devices. I can do stuff without resorting to crude hacks with openssl and nc. C itself it's far simpler. Text, you say? No locales, and UTF8 everywhere. I can freely resize the windows and still cut and paste stuff like nothing. It's 2025. The closest workflow under Unix would be Bitlbee + any client for it, msmtp and mbsync for Email and any graphical client against the SLRN cache in order to be as usable.

Rio can use different fonts just fine, you know. There are several users using 24 px fonts on HD screens without no issues. With riow you get 'virtual desktops' a la cwm/i3 and the like.

>Three button mouse. I don't do mouse chords, but I get more universal copy and paste as I stated that the old Unix itself, with shorter and easier scripts again... than Unix.

On snarf/paste instead of the menu, modyfing rio/sam and the like for a keybinding can be something done under an afternoon. Riow can already manage windows and close then with keybings among the mentioned virtual desktops.

Oh, and BTW... for vi users... I consider the Sam regular expresions far more powerful than the vi keys themselves. I can highlight the text with the mouse and write a sam command (on acme too) which affects the selection and in an easier way than the old syntax. The best of both worlds. RSI? Well, that's a point for Unix, but with the Windows key + 1-4 the mouse usage can be reduced a lot.

And, again, the 9front API it's dumb simple; I'm pretty sure doing stuff like mapping the Windows key +j-k-l to mouse button 1-2-3 would be something relatively easy, even setting sticky menus. With that small patch tons of usability issues would go away. Meanwhile, under X.org, Wayland, evdev and the $toolkit of the day... good luck.

networked 8 hours ago||
I don't think there is a client that will let me connect to 9front from Android, is there?

I see what you mean in this and the other comment. With 9front, you rely less on issuing commands to remote machines because you can directly access their resources. It's worth keeping in mind when comparing Plan 9 and Unix from a Unix user's perspective.

Being able to pick large fonts on the server isn't the same as leaving the fonts up to the client. When I use terminal emulators, SSH, and tmux, I can switch between different clients with different resolution, pixel density, and screen orientation and have the text display acceptably on each (minus text reflow for history, which is an issue).

> I consider the Sam regular expresions far more powerful than the vi keys themselves.

I agree, structural regular expressions seem like a better version of vi commands. It was reasonably easy to make some complex edits in https://github.com/martanne/vis when I tried it, and it felt like I'd only scratched the surface. I could see myself still using vis if it had tabs like Vim. (Tabs are a stated non-goal for vis.)