_xhr_, 20 days ago TIL that you can redirect clear(1)'s standard output to a file and the use cat on the file to clear the screen. $ clear > foo $ cat foo #unix #bsd #linux #openbsd
TIL that you can redirect clear(1)'s standard output to a file and the use cat on the file to clear the screen.
$ clear > foo $ cat foo
#unix #bsd #linux #openbsd
hexehelicen, 20 days ago @_xhr_ does that mean that it is a special output character, like color ? Wow, just tried it, it seems to be ^ [ H ^[ 2 J ^[ 3 J
@_xhr_ does that mean that it is a special output character, like color ?
Wow, just tried it, it seems to be ^ [ H ^[ 2 J ^[ 3 J
cmdrmoto, 20 days ago @hexehelicen @_xhr_ ANSI vs VT100 vs (etc) don’t all agree on what sequence to use. The “clear” utility queries your $TERM environment variable to decide which control sequence to print. In other words, this is neat, but not necessarily portable across terminal protocols
@hexehelicen @_xhr_ ANSI vs VT100 vs (etc) don’t all agree on what sequence to use.
The “clear” utility queries your $TERM environment variable to decide which control sequence to print.
In other words, this is neat, but not necessarily portable across terminal protocols
apodoxus, 20 days ago @_xhr_ $ clear > /tmp/foo $ xxd /tmp/foo 00000000: 1b5b 481b 5b32 4a1b 5b33 4a .[H.[2J.[3J
@_xhr_
$ clear > /tmp/foo $ xxd /tmp/foo 00000000: 1b5b 481b 5b32 4a1b 5b33 4a .[H.[2J.[3J
_xhr_, 20 days ago @apodoxus hehe, i used hexdump and did exactly the same :)
@apodoxus hehe, i used hexdump and did exactly the same :)
apodoxus, 20 days ago @_xhr_ It seems like 1B is the escape. I never paid attention to this before..
@_xhr_ It seems like 1B is the escape. I never paid attention to this before..
Add comment