News for hackers. Stuff that matters.
Re:Zsh and Fish’s simple but clever trick for highlighting m... by fiddlerwoaroof on Sunday June 14, 2020 @05:01PM (#23521346)
Isn't this sort of quirk what the terminfo/termcap databases are for? I guess adding new entries may no longer be feasible, but an entry there like "wraps at column" would allow every interactive command line program to benefit from fixes for new terminals.
Re:Zsh and Fish’s simple but clever trick for highlighting m... by ksherlock on Sunday June 14, 2020 @05:15PM (#23521458)
They're about 40 years ahead of you.

am: Flag whose presence means that writing a character in the last column causes the cursor to wrap to the beginning of the next line. If `am' is not present, writing in the last column leaves the cursor at the place where the character was written. Writing in the last column of the last line should be avoided on terminals with `am', as it may or may not cause scrolling to occur (see section Scrolling). Scrolling is surely not what you would intend. If your program needs to check the `am' flag, then it also needs to check the `xn' flag which indicates that wrapping happens in a strange way. Many common terminals have the `xn' flag.

Re:Zsh and Fish’s simple but clever trick for highlighting m... by ComputerGuru on Sunday June 14, 2020 @10:19PM (#23523197)
Yup. Fish checks both and acts accordingly, but they're kind of useless because `xn` could mean anything.

The real problem is I'm not sure when the last boolean capability was added to the termcap standard. While new terminals continue to add and update their termcaps, the spec itself is missing a lot of features that would help enormously.

Re:Zsh and Fish’s simple but clever trick for highlighting m... by thayne on Monday June 15, 2020 @03:45AM (#23524866)
I think the whole terminfo/termcap situation could be improved a lot. For one thing, most terminal emulators just report "xterm" or "xterm-256color" as the TERM environment variable, even though different terminals that report the same thing have different capabilities. A couple terminals, like alacritty and kitty, do ship with their own terminfo files, but that causes problems if you ssh to a box that doesn't have the terminfo file for that terminal.
Re:Zsh and Fish’s simple but clever trick for highlighting m... by JdeBP on Monday June 15, 2020 @04:15PM (#23532434)
It can definitely be improved. The model has some significant flaws. I started again from the fundamentals and came up with a rather different model for differentiating terminal capabilities.

* http://jdebp.uk./Softwares/nosh/guide/commands/TerminalCapab...

Note, in fairness, that not having the terminfo file is not a huge problem, as terminfo is designed so that one can transport information from one system to another, and place local database entries in one's home directory if necessary.

Re:Zsh and Fish’s simple but clever trick for highlighting m... by JdeBP on Monday June 15, 2020 @04:29PM (#23532576)
The Z shell takes xn to have a particular meaning, although not the one that it was supposed to have.

* https://unix.stackexchange.com/questions/167582/why-zsh-ends...

It was supposed to refer to a particular behaviour of Concept terminals. In practice, it is used in many terminfo records to denote DEC pending wrap, which the terminfo commentary even itself records as being different to the Concept glitch. Yes, terminfo has highly problematic paradigms that simply do not match how terminals and their emulators actually work.

* https://news.ycombinator.com/item?id=22691989

Re:Zsh and Fish’s simple but clever trick for highlighting m... by ComputerGuru on Monday June 15, 2020 @10:03PM (#23535240)
Regarding your second link, I cannot comment on the linked item as it has been archived by HN but as an additional reference for others and possibly a fun read for you: https://bugzilla.gnome.org/show_bug.cgi?id=754596

I like your TerminalCapabilities project.

Re:Zsh and Fish’s simple but clever trick for highlighting m... by JdeBP on Tuesday June 16, 2020 @07:22AM (#23537835)
I'll see your GNOME and raise you Microsoft.

* https://github.com/microsoft/terminal/issues/3177

Re:Zsh and Fish’s simple but clever trick for highlighting m... by msla on Sunday June 14, 2020 @06:36PM (#23521977)
I wondered if anyone remembered those things. So many people seem to be hard-coding escape sequences these days, making untold amounts of work for themselves.