TIL

- C does not support function overloading

- the \v vertical tab character is kind of the equivalent of starting a new line and then indenting to the end of the previous line

Follow

@derickflorian that's LF (\n); as I understand it, VT is like LF but can go down several lines, depending on how you've set up the vertical tab stops in your teletype

@radehi Here is what happened when I tried it just now. It goes down and over for me.

I can't say when I would need this except for formatting poetry on the command line. :)

@derickflorian yeah, is the same thing \n does if your terminal is not configured to convert it to \r\n. \v is basically unused nowadays but in its day would move the printer down to the next printable line on the forms you were printing on

@radehi oh, ok. Thank you for the background. The book I’m reading just said that \r\n is on Windows and \n is linux so I didn’t know the history or the behind the scenes on how it works!

It makes sense that a new line would not go to beginning if there isn’t a carriage return though.

@derickflorian There is a stty setting on Linux, onlcr, where the kernel inserts a CR (\r) before each newline (\n, LF) before giving it to the terminal. Programs using cursor addressing usually turn this off.

Teletypes sometimes needed a delay, or maybe a few NUL characters, following the CR character to give the carriage time to return to the left margin before they could process more characters (such as the line feed to advance the paper). There are settings in stty for this as well (crN, ffN, nlN, ofill, ofdel).

Probably at this point we should just repurpose \v for something else.

@radehi I had no idea about any of this. I will definitely take a look at stty out of curiosity when I have a chance. That is extremely interesting especially with the historical context!

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.