Terminal borders that don't cost a cell
joshka.net
joshka.net
Unfortunately mintty is the only terminal emulator I'm aware of which supports overstrike [0], as this would open up a world of new possibilities for TUI apps if more widely supported.
[0] https://github.com/mintty/mintty/wiki/CtrlSeqs#overstrike
But I’m not trying to argue for nor against either solution.
This isn’t an issue if you want square borders. But the screenshots in the article showed fancy rounded corners.
If you want those things then overstrike is insufficient.
It reminds me of the early days of Gchat, when people started using status messages for micro-blogging. The PM response to this was “status messages aren’t meant for that, we need to add a real micro-blogging feature so people can use status messages properly”. But I think it should have been “people are finding creative ways of using status messages, that’s great! How else can we encourage creativity?”
I've really enjoyed using it on paper: https://hughpyle.com/ASR33/
Ages ago I had found a software that would convert an image to ascii-art, and then used another tool called posteriza to split the large image into several A4s, which I then taped together and hung on my wall. Would love to do something similar but with better tools.
Damn, that's one from back in the day.
Edit: HN stripped the characters in question from my comment
The syntax is:
CSI 53 m SGR 53 — Overlined CSI 55 m SGR 55 — Not overlined
which is much more different than mitty's Control Sequence, but supports much more emulators
You might think it's a bit complicated, but I counter: so are terminal escape codes.
Pretty unlikely they'd be into adding a new ZWJ pattern for bordering characters since it's awful given unicode's main goal is interoperability. If you copy text out of your terminal, those characters come with it and probably won't render correctly in non-terminal applications (which don't have monospaced text cells), so you'll just see the ? missing character symbol between every letter. (Possibly overstruck onto the previous character depending on handling for the ZWJ.)
I guess the other way to look at this would be "should the background colour be a unicode ZWJ pattern?"... probably not. The border (and colour) is a property of the terminal cell rather than the actual characters IMO. It's not like `X + ZWJ + LEFT-BORDER` has any unique encoded meaning. Cell attributes like the article is talking about IS the less archaic way of doing this. ZWJ patterns are a lot more archaic and cause a lot more issues. Overstrike is fine, if it's being down with cell attributes (meaning, moving the cursor overtop of a cell, and stamping a new character on it instead of replacing it. Exactly how mintty does it.)
This was only true before emojis. Unicode introduced specific code points purely to alter visual display, such as skin-tone modifiers, etc. Now that the mission was already diluted for emo-fluff, you might as well add actually useful fluff.
The ones they DO let through, must have some sort of useful distinction in meaning to be given a code point(s). It can't just be useful as a little image of a thing. It has to provide some sort of linguistic concept that extends the emoji... language? https://unicode.org/emoji/proposals.html#factors_inclusion
The skintone modifiers are meaningful because it can look more like someone you're talking about. "S with a left border" isn't disambiguating any sort of meaning from "S with a bottom and right border".
It solves the z-index problem neatly for an individual cell as you just render in order (first underneath, second over the top). But it doesn't solve the order for adjacent cells - borders that lie between cells. At least not easily. Not an insurmountable problem.
Some perspective if you're unaware. Fonts have the unicode line drawing characters, but fonts don't align super well and so a good terminal will draw those characters with line drawing algorithms instead of as a font. I've got a WIP PR that I need to land in VSCode's that pulls in xtermjs and ghostty's line drawing stuff so that it fixes up all the existing gaps on that as an example of this problem.
Plus, just complexity wise, I'd much rather just have a DCS sequence to draw vector lines like the article's suggestion than first send all the borders then home the cursor, send the overstrike sequence, send all the content, send the overwrite sequence. That has so many more places where a session gets trashed by accidentally sending the wrong control character.
ECMA-48 had SGR 4 for underline since at least 1984, when an explicit SGR list was added to the standard. It introduced framed (SGR 51), encircled (SGR 52), and overlined (SGR 53) in 1986.
And forty years later people are still groping for a way to tell a terminal to put boxes around characters.
They've got a way. There's even a standard scheme for adding sub-parameters to the SGR 51 sequence to tell the terminal which parts to frame. So you could make that sub-parameter be 0 (ECMA 48 being default-to-zero for almost as long) for all sides and then 1 to 16 being various combinations of missing sides.
And do the same for SGR 52 to get rounded corners.
No additions to the standard SGR list necessary. No added DEC Private Modes. No extra bits to Unicode.
How i got here i find kinda interesting. Originally i was trying to leave the terminal. Using GPUI/etc frameworks. I kept running into the terminal though, because no matter how nice the UI is - the terminal still needs to work excellently.
Eventually i decided to try an abomination. To use a custom terminal which, not unlike Kitty images, allows generic apps to pass escape codes to control the UI components. Where the UI components have no restriction on "dumb terminals". So my text editor is a two part app, an editor and a tty to render the actual custom UI APC codes.
This paved the way for true smooth scrolling from within a terminal editor, as the editor effectively paginates but the tty scrolls within the buffered pages. It allows for different UI components to mix fonts and font sizes, eg popup docs being a different size than the other text, and .. well, anything i suppose.
I have to say it's working excellently and is slowly becoming my daily driver. I won't link it though, it's a fully vibe coded and even claude designed horror.
I'm surprised i've not seen more of this in the past to be honest.
The developer seems to have used AI heavily in the elisp code and it works very well.
> I'm surprised i've not seen more of this in the past to be honest.
This is what emacs is. It's a text buffer, but text can have properties like how to render, and custom values. then a bunch of commands to manipulate the buffer and it's contents.
I'll look into that, thanks!
I can only speak for myself but I use the CLI and TUIs specifically because of the limitations those modalities impose on software that uses them as the primary method for interfacing with the end user. If you want a full featured UI and all that comes with it why not just use QT or GTK or modern HTML or etc?
I think the only "improvements" I'd like to see are thing such as metadata regarding what the different streams are for, an official way to communicate using structured data as opposed to raw bytes, that sort of thing. Spiritually in the same ballpark as the difference between HTML before and after CSS.
I've written about it before, but in brief the mountain of standards is worth ripping out wholesale and doing write as a semantic protocol. It's needed to solve several things that work really poorly in terminals because their unit of compatibility is cells rather than a higher primitive. It's hard to bake something on top that works well.
The need is most strong in Accessibility, Text wrapping, Scrollback handling (i.e. making the scrollback editable and not dead text), and various other bits that make writing highly functional TUIs. Coding agents tend to find all those edge cases.
This often gets push back that it's easy, to which I can point nay sayers at the various many months long issues on things in Codex, Gemini, Claude etc. on flickering, scrolling, key handline, IME, ... doing anything moderately complex involves modeling a terminal in a terminal app effectively.
Ghostty and Rex sort of do the opposite bit. If you think of it like a stack, they write a new layer underneath that transports the cells on a better multiplexer layer 0. I think a new semantic layer 2 is an approach that would be neat to work with.
- When you write cells, you don't have an area of the screen that you can treat as the current area, which makes screen readers have to treat the screen as characters and recompose those back into words to read. You lose any rectangular area concept and treat lines in the terminal as lines that the screen reader reads. Semantically you throw away all the layout information by writing to the terminal.
- When you write stuff to the screen and then write enough lines to the screen to push lines into the scrollback, you lose the ability to change those lines in future. You can move the cursor anywhere in the screen viewport, but not anywhere outside of it. Scrollback is dead text once written there. This is fine for most apps that need append logic, but less so where you have reasons to treat the terminal as a space where you update it or gain access to things like expanding info. e.g. pick up claude code or codex and think about how you collapse a diff or command output to headers and then expand it, in the viewport, not a problem, in the scrollback it's dead text written once.
- There's a mismatch in the way that wrapping works when applied to the screen. If you're wrapping text at the screen boundary, and letting the terminal select across lines, it hits the edge of the terminal, and wraps to the next line. There's no concept of the edge of a block, because cells are the base level primitive. This affects selecting text, copying it, etc.
- Resizing terminals after stuff has written requires repainting the existing screen and then taking care about what was written to the scrollback history. E.g. if you have 200x50 and resize to 200x49, the top line just entered the scrollback and is now part of the history that you can't edit. Unless you clear the entire scrollback and repaint. Again similar problem and reasons. Resizing to 199x50 is worse, because you lose a character on each line, and push stuff into scrollback. And also the opposite 200x51, you just pulled a line from the scrollback now, so now you have to consider what to write back to that line later - what was dead is now alive again. These problems make writing terminal coding agents that rely on having interactive parts of the screen and history parts of the screen tough.
- Scrolling in general. If you look at how each terminal scrolls, and how many lines it maps to each mouse scroll wheel action, it differs per terminal, and it differs based on mouse / trackpad use as well. The events you get are not standardized in count, frequency, acceleration, ... This makes doing anything related to scrolling when you own the entire screen and scroll state a pain as you're trying to emulate the terminal's native feel and that differs a bunch. So there's a strong missing abstraction over scroll state things instead of just plain mouse events. Having a terminal and app level collaborate to tell where the scroll is up to is the approach that seems to be necessary here.
A lot of this comes from the fact that terminals are a mix of standards tracing back many years, stacked on top of each other, implemented poorly or not at all, ECMA, VT, DEC, iTerm, Kitty, OSC, ASC, DCS, SGR, ... and they all deal in cells being the basic primitive rather than the higher level semantic thing you need to do a TUI that is region aware. That's a impedance mismatch that is hard to bridge without a new standard that just sidesteps it completely.
If you look at the history of Codex / Gemini / Claude Code, they've each run into this problem a bunch over time and solved various bits of it / ignored other bits of it.
Fundamentally this is the wrong abstraction and it is painful to develop modern terminal features on top of it.
We need a terminal compositor protocol. We need to leave the pty behind and replace it with a unix socket. What other compositing protocols exist in the modern tech stack that we could extend?
Anyone can feel free to reach out to me if they want to chat about it: https://bower.sh
I think there was some discussion about this last time I mentioned the idea on hn a few weeks / months back. Trawl my history to find it pehaps.
It's narrower than replacing the cell grid. A program asks for a view the way vim takes the alternate screen. If the terminal answers, the program hands it the view's files once, and from then on the two exchange six small messages inside the normal byte stream (APC frames, the same trick kitty graphics uses). No port and no extra connection, so it works over plain ssh to a box with no GPU. When the program exits you get your terminal back, and in a terminal that doesn't answer the program can fall back to plain text.
A view is either a Lua script the terminal draws itself, in its own font and theme, or a sandboxed web page. The second one is exactly the "terminals are becoming browsers" worry from upthread, and I don't think that worry is wrong, which is why the native kind exists. Going through tmux is a non-goal: a multiplexer that doesn't pass the stream through untouched just means the program sees no host and falls back.
The only host so far is bateri, the macOS terminal I'm building, and the spec is an early Apache-2.0 draft: https://github.com/bateri/pencere/blob/main/spec/draft/pence...
Do they? Last time I checked you still couldn't select text via the keyboard in the Claude Code TUI.
Terminals work so well because there's a huge frictional cost to adding to the protocol. That's what keeps the protocol simple, which is what keeps multiple implementations feasible. Unlike the web, where unless you have GoogleBux you can't afford to implement it properly.
I also don't like the fact that each TUI application (btop, for instance) comes with its own color palette. So, a friend of mine developed a terminal (https://bateri.dev, macOS only for now, but the plan is to port it to Linux later) and yet another protocol where terminal SPAs can communicate over standard SSH (inspired by X over SSH, but we didn't like its drawbacks). The SPA itself is a set of Lua scripts that runs in a sandbox inside the terminal. The application on the host that communicates with the SPA can be implemented in any language (preferably Lua to keep it simple). With this approach, all SPAs (plugins) adhere to the user's color palette preferences. (There are more details that can share if you are interested.)
So far, to stress test it and help with devex, he has built a text editor (https://github.com/bateri/textpen) and a Docker/task monitor (https://github.com/bateri/dockerpen). I am also working on a plan document viewer that works within the terminal. We'd love some feedback if you are interested.
They clearly had this idea that they could eventually provide pretty much the entire block mode terminal experience, the entire screen being a form and the terminal smart enough to edit it locally, with a character mode terminal. Of course, it petered out in the early 1990s, after the mass market had discovered GUIs.
I don't generally like TUI's and think one gets more flexibility with raw text interfaces and being able to glue things together is more important then them looking nice. I think less fancy out put is better to be honest.
If we must embed 2D interfaces in terminals, I feel like we'd be better off putting in iframes or canvases that occupy a dedicated rectangle of cells.
You just run `mycommand connect host` and it will connect via SSH, start a Wayland server with X support, set up the appropriate environment variables, and also automatically reconnect, so you only have to do this once.
After that you can just run GUI commands via SSH and appear locally like you always wished they would. It uses a VNC-like image data protocol so the client works on any OS. And windows are seamless - no windows within windows nonsense. I haven't put much effort into the video protocol tbh but it's already better than Xpra and very usable with 100ms latency (London to NY) so that's good enough for me.
I'll try to open source it.
I think a better solution would be if SSH itself supported some GUI channel, but the only thing is the Kitty graphics protocol which kind of sucks tbh. I did try writing some tools using that for the GUI a while back but it's awkward because you have to use PNG, you're still stuck with the character grid for text, etc.
However, most X11 apps will have utterly abysmal performance on WAN SSH connections. Ancient apps will be slow because they block waiting for every response (this is unavoidable in Xlib) and less than ancient apps will be slow because they send full pixel data. It is possible to write a reasonably performant remote X11 app (using XCB instead of Xlib and always being aware of latency), but there are very few such apps. This is why Wayland dropped the requirement.
I'm running an old Qt X11 app with a modern retina MacBook with multiple different density screens and it works fine. There were some minor issues with that to start with but I pretty much just said "this happens, please fix it" and Claude figured it out without even having access to a Mac, which is impressive.
Honestly the thing that was hardest was keyboard layout. That kind of stuff never worked well for me in any remote desktop app, and now I can see why! You might never notice if you only use the US layout tbf. It works pretty well now though - I got it to query your local layout and the dynamically build an X keyboard layout and send it to the server.
I've run it with up to about 4 large windows and it seems to work fine. It doesn't send anything when nothing is changing so lots of windows won't matter unless they're playing videos or whatever - it's more designed for old Windows/Qt/Gtk style apps. I suspect you could do better with a traditional video codec but unfortunately the server I use has no GPU so that wasn't really an option.
There used to be one. It was called X forwarding. You'd run ash -X or ssh -Y and it magically worked.
1. The AI disclosure up front is very useful for cutting my blog filter time from 10 seconds down to 1, which is significant in the age of content overload. Hopefully disclosure becomes a point of pride for vibebloggers and they'll add it more often.
2. While it makes sense that the popularity of TUIs (driven mostly by CLI coding agents) sees maintainers try and push more spec into emulators, I'm hoping this doesn't become the standard. The whole TUI mentality just runs counter to what makes terminals such sticky tech in the first place.
2. I agree if you refer to TUIs that try to emulate/substitute complex GUIs, with sub-panes, dialogs, graphics, etc. I happen to love TUIs for simple text-only visualizations, though. They are usually quicker than GUIs and consistent among various OS, desktop...
But it IS relevant how something was made! It tells us how much of the detail that's presented in code & blogpost is the authors intent, and how much of it is "filler". It tells us whether the author can answer detailed question as to why they chose a specific implementation, or novel technique, or not.
It tells us whether the author wants us to read every syllable, or whether readers are expected to let their own summarize the article for them instead (as would be the case here).
It's never worth it to spend more effort reading something than the author spent writing it. The important part is the human intent, not the filler surrounding it!
I would rather frame it as an argument against credentialism.
No one said don't do anything new. Multiple people said that a proposed new feature to a standard should have proved value, and that patching a standard and its related tools could be a sign the feature isn't as needed as you think.
That's useful feedback to audiences developing against, consuming, and even writing those standards.
I added the ;) after posting to indicate some amount of good humor. Feel free to read it how you like, but I'm not here to provide insight to someone that literally said they didn't read the post as their first ever comment on this site. Was this your alt?
> No one said don't do anything new.
No. It's literally the first line of the comment I replied to:
> I'm specifically referring to maintainers trying to get new protocols (like border draw calls) into emulators.
> Multiple people said that a proposed new feature to a standard should have proved value, and that patching a standard and its related tools could be a sign the feature isn't as needed as you think.
For some actual insight - I don't think that requiring a standard to have proved itself is a good place to be here. It's literally what I'm asking for here. Find a way to prove this out. Does it work, does it fail in some bad ways. I don't care about the 'make this a standard part'. I literally wrote "I'm not attached to this being the exact solution, but I think it's a problem worth solving, and I'd like it to be more than one terminal's feature (and more than one weekend's worth of yak shaving)." in TFA.
We're living in an age where experimentation is cheap. We can look at ways to find out if these things are valuable by trying them. My blog post isn't about making a standard a standard, we're a long way from that here, it's about working out if it's something people would find interesting and useful in the terminal. As a library maintainer in that space, having seen many many terminal user interfaces, I feel identifying gaps like this is a necessary part that makes things move forward. One thing to note is that experimentation down a path doesn't mean that that path will be accepted / used / useful. We do that in software all the time - HTML blink tag, DHTML, Java Applets, ...
It does require a lot of deep coupling which is probably why it was abandoned, but also why it worked so well. You had things like passing menu subtree handles back and forth, so the host app and the embedded app could merge together their menus. This only worked because everyone on Windows was using the same menu subsystem, until Office 2007.
I'm not too familiar with higher level frameworks like Qt or gtk, but I suspect since they just draw the whole thing, that they only use single X windows and don't compose them, so you wouldn't be able to render a subview of them inside a different context.
They can also just draw on each other's windows and get input events on each other's windows. The connection between a window and its creator process is very weak: the window is automatically destroyed when the creator disconnects. And that's all. You can even turn that off, too. For every request that includes a window (or other resource) ID, nothing says that it has to be your window.
I virtualize AI models since I started using them, but they all communicate with me via the terminal emulator. Who knows what sort of exploits are hiding in these things? They could reach my host through them.
What's the reality with these new frameworks? Whenever I see one i worry that it renders at 144 Hz in a loop instead of redrawing only when something changes, for one. And let's not mention redrawing only the areas that have changed [1].
Should I ask about ram consumption too?
[1] ... which is why vi is the best editor to use over slow, unreliable links.
This one in particular seems to have the terminal render the effects, so if there's blame it lies elsewhere.
Hmm relying on a terminal extension that only implemented in one terminal could also be a concern, but maybe it's time terminals evolved.
One of the top 5 "smells" of LLM generated websites that I can't stand is everything has to have its own round-rect. Everything in a box. Every button, label, header, subheader, so much fucking noise everywhere. You shouldn't need that many.
Another, of course, is the phrase "The wire format", included in this post. Oh yeah, its the format on the wire? What wire? The wire between my psuedo terminal and my kernel? What garbage. Cool exploration but, come on: "The common path is a pen, held in the cursor like the current background color. Set it, print some text, and the printed cells get the borders:" shit is not OK to post
I used ratatui there mostly so that I could prove that it would work in real looking apps that do panels and similar stuff that benefits from borders.
But yeah, compat is key. It would probably go out to ghostty, rio, kitty pretty easily, terminal.app never, other terminals much slower. IDK about the windows / linux side of things.
BTW, love ratatui. I've been building ratmark lately, for markdown rendering. But I really need link support ;)
Interestingly enough the kitty author has declined a feature request similar to this couple years ago in https://github.com/kovidgoyal/kitty/issues/7511 but the approach here seem to have not resulted in any of the major pains he was expecting in that message. It is valid point that implementing something like this on a single terminal might not be worth it, but now we have poc available for two major ones I guess?
Anyways, branch and write-up available here: https://github.com/errnoh/kitty/blob/cell-borders/CELL-BORDE...
(The usual disclaimers apply: all of the actual code is AI written)
Somthing I think could be intresting to go along with this is for the terminal to be able to distinguish sub-windows using these border, so if you've got a popup and try to select multiple lines in it, you'll actually select only the text in thr popup rather than the whole terminal-wide line.
But for there to be a dedicated section on how multiplexors wouldn’t work suggests to me that the authors already tried this via tmux.
So I’m left wondering what they’ve done with the implementation of this to make that a problem.
I spotted they are using DCS sequences. But even that shouldn’t be an issue itself.
I wouldn’t recommend APC because Apple Terminal doesn’t follow spec with APC parsing (one of the reasons I switched some of my custom sequences from APC to OSC).
Regarding the extra state to be tracked, tmux wouldn’t handle that cell state. That would be down to the terminal emulator.
Since these are cell properties, it does feel like CSI would be the right place (like Kittys undercurl).
A while ago I coded this up with a Ratatui subset on the Commodore[2] but I think this paradigm could be useful for modern TUI apps as well. One example I'd use that for is a minimap, which is quite awkward to do in characters.
[1] Plus the occasional whole screen offset and raster effects.
[2] Code is not public yet but there is a screenshot how it looks. https://github.com/weinzierl/8-bit-rust
But... "nicer than box-drawing characters" is such a low bar. The semigraphics are right there, and can be beautiful! They've been part of DOS (cp437) since the very beginning, and Unicode has a more-than-adequate variety.
Here's my afternoon's experiment: `prtty`
There's some bits that feel like they probably make sense to consider doing other ways, like how border placement works (inside, outside, on the border, etc.), and how the filling works - to make borders incorporate external or internal padding.
I find it horrible. Slow, colors are inconsistent, resizes are not always propagated to apps...
What terminal do you use on Linux that makes you miss WT?
Also, selecting and replacing could be done without a a mouse. Quite often I want to select, copy, replace, paste somewhere else. Not possible without a mouse.
Instead of adding extension over extension on top of some old protocol. And using a lot of hacks to get stuff done.
To be more precise, TERM contains a single name, a key to index terminfo, a database of all known terminals and their capabilities. It assumes that such database is up to date and that every app has access to it, which is not always true, especially on non-unix platforms.
However, apps have begun using the name "as is", comparing it against known strings, e.g. "xterm", which led many terminals to advertise themselves as xterm just to ensure compatibility with existing apps.
A truly meaningful substitute for TERM would be a "semantic TERM", a variable that, setting apart the name of the terminal, focuses on the capabilities it offers. Not the complete set of properties listed in terminfo (we can give most of them for granted, today), but just the subset that differentiates modern terminals, like colors, kitty's protocol, OSC133, and a few others.
The charm of the terminal is that you can do whatever you want, as long as it fits in one cell.
Is it because it looks visually crowded?
It reminds me of video games overlays / layers (like the gameboy window layer) used to display HUDs.
It's kind of funny, I posted this here and there at similar times. Expected to be spam flagged there due to the anti-AI brigade, but my submission here was the one that actually got hit (likely because I disclosed AI use in the post body is my guess).
I like seeing different points of view, and maybe controversial topics should be discussed () more than others, not less.
and discussed means fact-based, civil discourse, not piling on
[background color, top, left, bottom]B[top, bottom only]UTTO[top, bottom, right]N[reset]
I probably missed on something, but I stopped there
Whatever the author is doing works reasonably well to be readable and inoffensive.
Thanks for Ratatui, which certainly has a top tier name, and also has had tons of great software written with it! I've been inspired by much of that ecosystem, especially the charting libs. The weird GUI stuff I'm doing with Kitty+Bubbletea, can certainly be done on Ratatui, in the spirit of Makepad. IMO, Golang needs this more than Rust.
[1] Viewing the gloss README in the Gloss web viewer (Golang WASM in a Ghostty frame), press 't' to typeset it. Alpha release quality. https://nimbleterminal.github.io/gloss/app.html?src=https%3A...
I like simple, predictable TUIs which i can operate with keyboard input only. I don’t like ui chrome or complex ux in TUI, i prefer GUI for that.
I believe the relevant saying here is, "normies ruin everything". Now that LLMs have allowed them to breach the command line, "Chrome, here we come!"
Son of a motherfucking bitch.
> instead of hacks on top of hacks
Afraid that’s a contradiction. In this role, HTML is a pile of hacks upon hacks that was not originally intended for UIs.
But, yeah, people are trying to reinvent GUIs. By layering hacks over TTYs. If only there’d be some protocol for widgets and events over a stream connection…
what we are missing is a really high level protocol/system that takes really high level data and figures out the presentation on its own.
take a list of files for example. you can run ls -l in a terminal and it will attempt a crude text based formatting of the output. or you can run a full gui filemanager.
what if there was a command that would produce ls output as a table data structure, run in a sort of terminal that knows how to format a table nicely without the ls command having to include any formatting instructions? this terminal would have support for all sorts of data types and structures to display all of them nicely.
So, powershell? For some reason only IT jockeys on Microsoft's death grip remember and use its full capability after learning it.
ls's output (and a few other programs') are human facing. They're not meant to be machine readable.
> what if there was a command that would produce ls output as a table data structure, run in a sort of terminal that knows how to format a table nicely without the ls command having to include any formatting instructions? this terminal would have support for all sorts of data types and structures to display all of them nicely.
Because that's just complexity for its own sake. What's simpler is to just create a shell alias for a particular view you want. The shell is for interactive usage, with some capabilities for automation. If something better is needed, you write a real program for it.
many shell scripts are using ls as input. maybe a better example is ps. that's even more common i would guess.
the goal that i am proposing is to separate output and presentation. that is way more powerful. make commands with machine readable output, and add a presentation layer that converts that to something human readable.
for backwards compatibility you could call that command "show" so you would have
ps | grep | sort | show
where every step except the output at the end deals with machine readable data.future terminals could skip the "show" step and read and format the machine output directly with all the power that this gets you such as the ability to reorder or resize columns, change the sorting order, etc, for the ls case like a gui filemanager, but commandline driven and able to handle any output of any command.
create a shell alias for a particular view you want
which shell alias lets me easily reorder or remove columns from ls or ps output? or change the sorting order with a single key press (like top does for example)
top/htop is a good example btw: it's an interactive interface for the output of ps.
imagine you could do the same thing by just running ps or ps | show? generic enough that it works for most commands producing structured data?
* https://jdebp.uk/Softwares/nosh/guide/commands/list-process-...
* https://jdebp.uk/Softwares/nosh/guide/commands/console-flat-...
And the bit in the middle is an exercise in awk or mlr.
I get where you're going and am genuinely curious, what does a "better" system designed to do what HTML/JS have become actually look like? (or what would one look like?) There has to be markup of some sort, and there has to be scriptable interactions of some sort, right? If not, how else would it work?
That said, yes: NeWS, XForms, rio, and many others have tried with arguably cleaner designs. Not without their own issues, but in comparison to HTML, driving GUIs was a design goal from day zero (not a direction shift), and they're a lot smaller and simpler (which has its pros and cons).
In fact it just makes it less secure.
It can already port forward so you can basically already do this, I don’t think that’s insecure per se.
It's wild how LLM written text is a contaminant detectable in the parts-per-million range.
Saying that, the idea is actually good, and I at least appreciate that the author warns ya up front.
I've made the point elsewhere that the actual spec is the the bit I care least about on this. There's multiple ways that are valid for actually doing it - DCS, ASC, SGR, CSI, Overtype, etc. - the point of it is to argue for the outcome borders that are are between the cells not using one.
So the "borderless" (0 pixels) / zero "useless gaps" simply are confusing and... Wrong.
But then people who do use useless gap, as in TFA, get it wrong too: they typically add gaps near the monitor's edges.
Yeah. But no. Sorry but my monitor's edge is a perfectly fine gap. I don't risk mistaking it for anything.
So I modified my WM (the Awesome WM) to do proper "useless gaps" computation and remove the ones that really are useless: and that'd be those near the monitor's physical border.
I mean: nearly everybody gets it wrong, but it's not complicated to get it right, is it?
P.S: even the terminology is wrong... People calling those "useless gaps" haven't got a clue: they are useful. The only useless ones are the one on the monitor's edge (if your monitor has physical edges, which it probably does).
The test app has a key to turn that off see https://github.com/joshka/ratatui/blob/joshka/cell-borders/C...
The side gaps were for for making it feel balanced in the screenshots and visualizations to be able to show where the borders line up with cells easily etc. It wouldn't be what I'd use in a real app.
One thing to note though is that some things which are "wrong" can be aesthetically pleasing to look at and may be the actual best UX in certain situations. There's a lot of new design principle work (especially in macOS / iOS) that is about things going past the edge, or being overlaid with floating things. Some of this is "wrong" some of it is wrong, and some of it sitting in in the useless gap beteen the two. ;)
The part I'd want specced early: borders are per-cell, but cells aren't per-grapheme. A CJK char owns two cells plus a continuation placeholder, and combining marks or ZWJ emoji sequences own zero-or-more depending on whose wcwidth table you ask, so app and terminal routinely disagree across Unicode versions. Today that shows up as a vertical bar one column off; with cell borders it becomes a line that stops short of the corner. Does the border attach to the cell or to the grapheme cluster?