3 ms·
Yep, on Unixen the translation of CRLF to LF when printing to the terminal (and from CR to CRLF when reading input from the terminal) is done in the kernel, it'
by Joker_vD 6mo ago
Yep, on Unixen the translation of CRLF to LF when printing to the terminal (and from CR to CRLF when reading input from the terminal) is done in the kernel, it's called "line discipline".
- poizan42 6mo agoAnd if you switch the tty from "cooked" to "raw" mode then it doesn't do the conversion, and a CR just moves the cursor back to the start of the line and a LF just moves the cursor one line down.
- fragmede 6mo agoWhich is how you do the fun spinny icons on the command line without having to invoke ncurses!
- freedomben 6mo agoYou can also just use a \r directly without a \n. For example: spin='/-\|' while true; do i=$(( (i+1) % 4 )) printf "\r${spin:$i:1} Working..." sleep 0.1 done
- freedomben 6mo agoBy the way yes, that is a subtle reference to the TOS computer, so it's best read in that voice :-)