5 ms·
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 th
by ksherlock 6y ago
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.
- ComputerGuru 6y agoYup. 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.
- thayne 6y agoI 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.
- JdeBP 6y agoIt 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/TerminalCapabilities.xml 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.
- JdeBP 6y agoThe 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-a-line-with-a-highlighted-percent-symbol#comment1079152_302710 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 https://news.ycombinator.com/item?id=22691989
- ComputerGuru 6y agoRegarding 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 https://bugzilla.gnome.org/show_bug.cgi?id=754596 I like your TerminalCapabilities project.
- JdeBP 6y agoI'll see your GNOME and raise you Microsoft. * https://github.com/microsoft/terminal/issues/3177 https://github.com/microsoft/terminal/issues/3177