Swordfish90 / cool-retro-term

A good looking terminal emulator which mimics the old cathode display...
22.03k stars 839 forks source link

Moving cursor to the beginning of previous line #660

Open keybreak opened 3 years ago

keybreak commented 3 years ago

Instead of:

printf "\e[F"

one has to do

printf "\e[A\r"

to move the cursor to the beginning of the previous line.

In most terminals that's not the case, some interactive scripts may break.

yurikhan commented 3 years ago

Scripts that send hardcoded escape sequences are broken to begin with. Instead, scripts should use tput that will consult the terminfo database for the current terminal and emit the relevant sequences.

Also, \e[F is not featured in xterm’s terminfo, while \e[A is (as capability cuu1).

The fact that cool-retro-term sets the TERM variable to xterm is only tangentially related to the point I’m driving here.

keybreak commented 3 years ago

In xterm you can use \e[F.

yurikhan commented 3 years ago

You’re missing the point. Yes, xterm implements \e[F and documents it in its own manual. No, you cannot use it portably in scripts, because it is not exposed in the terminfo database.

keybreak commented 3 years ago

Well yeah because some choose not to, it's not something to debate really. Most of the terminals i've tested support it, even most debloated of all st or even freaking Windows :rofl:

So i'd absolutely love CRT to support it as well and become one of the serious and more compatible ones.