How often are complex scripts rendered in terminal? What is the cost to scripts that are currently rendered accurately by terminal? Are there any group of tools that operate in complex scripts?
EDIT: Without saying that I think this is worthy and cool. I am just curious about the costs and benefits of such a tool.
Falsehoods programmers believe about text:
- Everybody just uses english text, right?
- Ok, sometimes there might some weird accents or something
- Every character is about the same width
- Well, they're all integer numbers of characters wide
- No character is taller than an english I
- Everybody writes left to right
- Everyone writes horizontally
Also https://jeremyhussell.blogspot.com/2017/11/falsehoods-progra...
EDIT: How the hell do you format lists in HN comments
The issue is handled both by Emacs and Acme by eschewing the terminal. Instead they use the shell (and direct command execution) for commands. So that means no terminfo/termcap, ncurses, and escape codes (but Emacs have a library to parse some ansi codes).
I used Rich library in python. And it was recommended to me by claude as top tui library in python space.
It can't handle terminal window resize and the layout gets messed up
I was surprised to see node based cli work much better with resize?
Anyone knows why?
> The real fix requires agreement at the protocol level, across terminal emulators, shell applications, and TUI frameworks simultaneously.
Yeah, and ideally you want the backward compatibility, so we don't have to recompile the world or patch things like e.g. cat.
But yeah, the root of the problem is that a) the TUI-like application that manually drives the terminal, with cursor movement/line folding/redrawing etc. needs to know, at every single moment, the precise location of the cursor and the coordinates of every single character it outputted (to e.g. properly handle backspacing, including over the line folds: \b explicitly doesn't move to the previous line by default and very wide and old convention), and b) getting that coordination info from the terminal in quick, reliable, and side-effect free manner is impossible, so you have to guess.