Live data from Hacker News

Everything you ever wanted to know about terminals

xn--rpa.cc

91–100 of 191 posts

Re: Everything you ever wanted to know about terminals

#91

The author seems not to be aware of the recent TUI rennaisance[1]. There are libraries like termbox and blessings (python) that are a middle-ground between full ncurses and adding your own ansi codes. There are a lot of modern TUI frameworks like tui-go or tui-rs that bring common GUI conventions back to the TUI (heck there are TUI programming libraries that are designed to be similar to react) - these too tend to be…

Make sure to check out Notcurses! https://github.com/dankamongmen/notcurses#readme demo: https://www.youtube.com/watch?v=dcjkezf1ARY

> Make sure to check out Notcurses!

This so much! Dank, Jart, Yatli and HPA are 4 people whose work is single handedly pushing TUIs forward.

There are others, but these 4 are the poggers, and I don't think the likes of me (or Christian, or Autumn, etc) can stand the comparison.

Notcurses is a unique work of love and art worth all the praises in the world.

Re: Everything you ever wanted to know about terminals

#92

off topic but I would love a version of this with a more "plain" colors/ punctuation/formatting. finding it very hard to read / navigate anyway the content looks good so will try to find time to sit down and read this "essay" soon

The colors are very distracting on my monitor.

> The colors are very distracting on my monitor.

It's interesting, because I sometimes also find colors distracting, so for my Vim and other terminal tools I make an intensive use of text attributes (like bold, italic, underline and their various combinations)

Your comment may incentivize me to release my monochrome vimrc: it looks quite good on mintty/msys2 or Windows Terminal, and still very decent with xterm!

Re: Everything you ever wanted to know about terminals

#93

Earlier quoted context omitted.

As the article states: > being compatible only with ANSI-capable terminals is a feature, not a bug Driving old hardware terminals (as opposed to terminal emulators) is a fun stunt, not something of actual modern value. Every modern terminal emulator supports ANSI escape sequences. Some features are supported by a subset of terminals, but you can either 1) probe for those features by asking the terminal, which some te…

> Every modern terminal emulator supports ANSI escape sequences Is this true on Windows? My understanding is that quite a few TUI libraries don't have windows support.

This is true for the new Windows terminal, which is more-or-less xterm compatible.

Re: Everything you ever wanted to know about terminals

#94
post #40

A while ago I was trying to find a way to make my terminal scroll back up after a command executed, so that if the output was long I could read it from the top without having to scroll up manually. There are ways to get yours shell to print something after the command executes, so I just needed to find an ansi escape sequence that would scroll up. Unfortunately I didn't see any sequences that do this. Anyone have any…

> Unfortunately I didn't see any sequences that do this. Anyone have any ideas?

Assuming you tried moving the cursor vertically, have you tried the alternative approach of Store Cursor Position / Restore Cursor Position cf https://stackoverflow.com/questions/28986776/ansi-escape-seq...

The scrollback buffer may be a limitation, so you should try with enabling or disabling the alternate screen (ti/te)

If that fails, you may have to tweak your terminal emulator to "hook" the SCP/RCP to a specific point of the scrollback buffer, to allow this scrollback.

Re: Everything you ever wanted to know about terminals

#95

The author seems not to be aware of the recent TUI rennaisance[1]. There are libraries like termbox and blessings (python) that are a middle-ground between full ncurses and adding your own ansi codes. There are a lot of modern TUI frameworks like tui-go or tui-rs that bring common GUI conventions back to the TUI (heck there are TUI programming libraries that are designed to be similar to react) - these too tend to be…

Make sure to check out Notcurses! https://github.com/dankamongmen/notcurses#readme demo: https://www.youtube.com/watch?v=dcjkezf1ARY

Oh my god. This is crazy. I never knew this could be done. Thanks

Re: Everything you ever wanted to know about terminals

#96

Earlier quoted context omitted.

As the article states: > being compatible only with ANSI-capable terminals is a feature, not a bug Driving old hardware terminals (as opposed to terminal emulators) is a fun stunt, not something of actual modern value. Every modern terminal emulator supports ANSI escape sequences. Some features are supported by a subset of terminals, but you can either 1) probe for those features by asking the terminal, which some te…

You don't need terminfo until you need to redirect those fancy outputs to a file, or you see a lot of weird [M; in your CI logs, or your ssh session does not display full 256 colors, or you question why we don't have true images in our terminals when we have bitmap escape codes for decades now[1]. No terminal was created equal and never will. terminfo is about future as it is about the past. Color ansi codes might be…

> until you need to redirect those fancy outputs to a file, or you see a lot of weird [M; in your CI logs

The application should be checking isatty by default, unless the user overrides that.

> or your ssh session does not display full 256 colors

I've most often seen this kind of thing because the remote end doesn't have the right terminfo entries for the local terminal.

> or you question why we don't have true images in our terminals when we have bitmap escape codes for decades now

Sixel, specifically, doesn't seem to have much support other than in xterm itself (as opposed to otherwise-xterm-compatible terminals). And other bitmap extensions are something that many terminals support autodiscovery for.

> No terminal was created equal and never will. terminfo is about future as it is about the past.

Part of the problem is that terminfo doesn't have much info about the future, as opposed to the past.

For going beyond terminfo, I think autodiscovery protocols would be a better future path.

Re: Everything you ever wanted to know about terminals

#97
post #90

My understanding is that control codes for [every possible modifier key combination] + ['standard' US keyboard keys] aren't all standardized. Is that correct? I seem to recall having a hell of a time trying to figure out which key combinations Emacs could understand and why (keyboard -> OS -> terminal emulator -> protocol -> program.) Are there any proposals? Workarounds? Proofs-of-concept?

> Is that correct? It's not exactly like that - it's more like there are competing "standards" and interpretations of these standards, and sometimes supporting one means not supporting the other. Fortunately, such things are rare, and can be addressed by GUI options. Take for example SGR1 for "bold/intense" text: read the whole issue that came to Microsoft Terminal team in 2018 up to its most recent discussions on ht…

It sounds like you’re talking about output, not input.

Are there standards to represent, for example, Ctrl+Alt+* (I.e. Ctrl+Alt+Shift+8) ? Additionally with cursor keys, Insert, Delete, Backspace, F1 - F12, etc.

I’ve searched several times for such standards before but never had any luck…

Re: Everything you ever wanted to know about terminals

#98

The author seems not to be aware of the recent TUI rennaisance[1]. There are libraries like termbox and blessings (python) that are a middle-ground between full ncurses and adding your own ansi codes. There are a lot of modern TUI frameworks like tui-go or tui-rs that bring common GUI conventions back to the TUI (heck there are TUI programming libraries that are designed to be similar to react) - these too tend to be…

or rich/textual, for python, which really heap the shiny up high!

OK, this is nuts. How are they doing smooth scrolling? I want that on tmux bad.

I'm suddenly really excited for what can be done on TUIs. Like I was some 40 years ago.

Edit: and you can write CSS instead of curses? That's seriously cool.

Re: Everything you ever wanted to know about terminals

#99
post #54

I'm sure this is very interesting but I couldn't make it past the first sentence. I'm sure there's a term for someone who writes like this, but all I could think was "redditspeak," or otherwise stale tryhard wacky. Forcibly inserting so much 'character' into your sentences that your syntax implodes.

I’m not sure if there’s a term yet. I like to call the general vibe (colors, unnecessary font variations, “I’m gods gift to humanity and all you people and your years of hard work are idiotic and beneath me, even though I have yet to do anything life changing” attitude): programmer wishing they were postmodern artist.

Re: Everything you ever wanted to know about terminals

#100
post #40

A while ago I was trying to find a way to make my terminal scroll back up after a command executed, so that if the output was long I could read it from the top without having to scroll up manually. There are ways to get yours shell to print something after the command executes, so I just needed to find an ansi escape sequence that would scroll up. Unfortunately I didn't see any sequences that do this. Anyone have any…

Run a tmux session, then you can scroll back as many lines as it preserves (configurable).
Post reply on HN