6 ms·
Very cool! But I’m just a bit sad that this is “just” a set of effects implemented on top of the same old standard ANSI escape codes as primitives. I’ve been w
by derefr 2y ago
Very cool! But I’m just a bit sad that this is “just” a set of effects implemented on top of the same old standard ANSI escape codes as primitives.
I’ve been waiting for one or more terminal emulators to get together and add some ridiculous new escape codes, such that animated effects (or things like collapsible sections, font size, “form-input-ness” and “form-button-ness” ala 3270, etc) all get treated as part of the state of a given character cell / run of character cells.
Heck, it’s 2024; an application should be able to use an escape code to set a soft-word-wrap mode for longer-than-viewport-width text, and have the TTY render text accordingly, rather than everything being hard-wrapped (baked mode) or not wrapped at all (raw mode) and only being able to get soft-wrapping using a pager!
(There’s precisely one thing like this I’m aware of terminal emulators adding in recent memory: clickable links, ca. six years ago.)
- emmelaich 2y ago"Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?" 93 points by andrewstuart on Sept 8, 2020 | hide | past | favorite | 63 comments https://news.ycombinator.com/item?id=24412687 https://news.ycombinator.com/item?id=24412687
- mkotowski 2y ago> (There’s precisely one thing like this I’m aware of terminal emulators adding in recent memory: clickable links, ca. six years ago.) And they are often disabled by default, as a potential security risk. We don't get to have fun things, do we? (also worth read: CVE-2003-0063, abusing escape seq is unfortunately a valid concern against adding more stuff). On the other hand, more and more emulators are adding support for various graphic protocols (sixel, iTerm2 format, kitty format). > I’ve been waiting for one or more terminal emulators to get together and add some ridiculous new escape codes[...] Well, it's not much, but mintty apparently has some interesting stuff like audio support[0], and codes for font size and font family[1][2]. iTerm2 also has a bunch of custom escape sequences of varying level of usefulness starting from displaying fireworks animation on cursor position to sending system notifications[3] (although sadly I could not get the last one to work for me). For some semblance of forms, you can check bubbles[4] and gum[5] (binary to easily incorporate the components into shell scripts). [0]: https://github.com/mintty/mintty/wiki/CtrlSeqs#audio-support https://github.com/mintty/mintty/wiki/CtrlSeqs#audio-support [1]: https://github.com/mintty/mintty/wiki/CtrlSeqs#font-size https://github.com/mintty/mintty/wiki/CtrlSeqs#font-size [2]: https://github.com/mintty/mintty/wiki/Tips#alternative-fonts https://github.com/mintty/mintty/wiki/Tips#alternative-fonts [3]: https://iterm2.com/documentation-escape-codes.html https://iterm2.com/documentation-escape-codes.html [4]: https://github.com/charmbracelet/bubbles https://github.com/charmbracelet/bubbles [5]: https://github.com/charmbracelet/gum https://github.com/charmbracelet/gum
- derefr 2y ago> And they are often disabled by default, as a potential security risk. Well, that and a clickable link would conflict with mouse reporting if both were active at once. Given that mouse reporting exists, and "has precedence" due to its age, I think iTerm's choice — to style the anchor-SGR text either way, but to only make them actually act like links rather than text if you hold a modifier key — is the only "correct" behavior for rendering anchor-SGR text, regardless of security concerns. But that really wouldn't be true for most other potential novel graphical-rendition "styles." Anything that's non-interactive could certainly be on by default.
- follower 2y ago> [...] waiting for one or more terminal emulators to get together and add some ridiculous new escape codes [...] I'm definitely of the opinion[0] that we haven't yet reached the limits of the "terminal emulator" UX paradigm. The past few years do seem to have seen a resurgence in terminal emulator innovation due in part to a combination of new languages, the prevalence of GPUs, and a realisation that many of the existing terminal emulators weren't interested in any innovation in certain directions. I've particularly been interested in the possibilities provided by the Terminal Graphics Protocol (which I discuss more in the linked comment). A couple of years ago I switched to WezTerm[2] due to a combination of its graphics support, implementation language (Rust) and that its main developer seems to be interested in a combination of both solid support for existing standards & opportunities for innovation. WezTerm also provides opportunities for customisation both in terms of shell integrations and of the application itself[3]. > [...] new escape codes [...] Also, on this aspect, it may not even be necessary to create new escape codes--recently I discovered the `terminfo(5)` man page actually makes a pretty interesting read[7], in part because it lists some existing escape codes that seem like they have potential for re-use/re-implementation in the current day's more graphic-based systems. ---- footnotes ---- [0] As I mentioned in a recent comment on a thread[1] here: "Motivated by the thought that at the current point in time perhaps the 'essence' of a 'terminal' is its linear 'chronological' presentation of input/interaction/output history rather than its use of 'text'." [1] https://news.ycombinator.com/item?id=40475538 https://news.ycombinator.com/item?id=40475538 [2] https://wezfurlong.org/wezterm/ https://wezfurlong.org/wezterm/ [3] While I'm definitely not a fan of the choice of Lua as the extension language, I have now at least hit my head against the wall[4] with it enough that I can actually get more complex custom functionality working. [4] I've started to write up some of my Lua-related[5] notes & more general WezTerm[6] notes so hopefully it'll eventually be an easier road for others. :) [5] https://gitlab.com/RancidBacon/floss-various-contribs/-/blob/main/wezterm/wezterm-lua-cheatsheet-docs/notes--wezterm-lua-cheatsheet.md https://gitlab.com/RancidBacon/floss-various-contribs/-/blob... [6] https://gitlab.com/RancidBacon/notes_public/-/blob/main/notes/notes--wezterm.md https://gitlab.com/RancidBacon/notes_public/-/blob/main/note... [7] As one does. :) It was a fascinating/amusing time capsule in terms(!) of mentions of weird hardware terminal quirks that at one time ("before my time") needed to be worked around; interesting escape code discoveries; and, the mention of a term I had not thought of for decades but was at one time of importance: NLQ! :D