Live data from Hacker News

What happens when you open a terminal and enter `ls’

warp.dev

21–30 of 60 posts

Re: What happens when you open a terminal and enter `ls’

#21
That article starts with too many inaccuracies to recommend it to anybody: - Teletypes were designed about a century before the era of mainframes. - Mechanical teletype did not have an "I/O driver" in it. - OS on Mainframe computers did not have a "Kernel", and neither "I/O driver", "Line discipline" or "TTY driver". This model was introduced with UNIX, the OS that ran on minicomputers. - Was ChatGPT used to write this article? ;)

I've recently stumbled upon an article on the same topic, but containing competent and accurate information, I have a link because I recommended it to a friend: https://thevaluable.dev/guide-terminal-shell-console/

Re: What happens when you open a terminal and enter `ls’

#22
> ASCII text would be transmitted character-by-character over the wire as the user typed.

How does that work exactly on a lower level, say the current? ASCII text would be decoded to the binary and 1s would be high voltage and 0s would be low? And if there's no data transmitted it would be all low voltage?

Re: What happens when you open a terminal and enter `ls’

#23

> ASCII text would be transmitted character-by-character over the wire as the user typed. How does that work exactly on a lower level, say the current? ASCII text would be decoded to the binary and 1s would be high voltage and 0s would be low? And if there's no data transmitted it would be all low voltage?

It still works the same way, just abstracted as individual characters and not specifically the implementations of electrical representations of keys. Every character is stateless, so whatever's before or after doesn't matter. So this means that some operations are a lot easier and a lot harder than they otherwise might be, because while you only have to make a decision for one character at a time, you need to keep an internal state if you want to display characters or do something with them as a whole.

Re: What happens when you open a terminal and enter `ls’

#24
post #21

That article starts with too many inaccuracies to recommend it to anybody: - Teletypes were designed about a century before the era of mainframes. - Mechanical teletype did not have an "I/O driver" in it. - OS on Mainframe computers did not have a "Kernel", and neither "I/O driver", "Line discipline" or "TTY driver". This model was introduced with UNIX, the OS that ran on minicomputers. - Was ChatGPT used to write th…

Hi. I definitely took some liberties with terms here. For example, I said "I/O driver" instead of, say UART driver because I didn't want to get overly specific on the historical part. That wasn't the focus of this article. Thanks for linking this other one, as it fills in those parts well.

Re: What happens when you open a terminal and enter `ls’

#27

> ASCII text would be transmitted character-by-character over the wire as the user typed. How does that work exactly on a lower level, say the current? ASCII text would be decoded to the binary and 1s would be high voltage and 0s would be low? And if there's no data transmitted it would be all low voltage?

On the old terminals, the wire sits at one voltage level until a character is transmitted. After that, the bits are spaced out at agreed-upon time intervals. So the receiver detects the first transition, and then reads and stores the bits by applying the same timing, then waits for the next character. Meanwhile, the value of that character, say an 8-bit number, is stored in a register, and typically the processor is interrupted. This gives the processor time to deal with each character before the next one is received.

Oddly enough I could have answered the OP's question in an interview, 40 years ago, but stuff has gotten so complex that I can't even tell you what all of the layers of abstraction are.

Re: What happens when you open a terminal and enter `ls’

#28
post #21

That article starts with too many inaccuracies to recommend it to anybody: - Teletypes were designed about a century before the era of mainframes. - Mechanical teletype did not have an "I/O driver" in it. - OS on Mainframe computers did not have a "Kernel", and neither "I/O driver", "Line discipline" or "TTY driver". This model was introduced with UNIX, the OS that ran on minicomputers. - Was ChatGPT used to write th…

> This model was introduced with UNIX

The UNIX IO system was adapted from Multics.

Re: What happens when you open a terminal and enter `ls’

#29
post #21

That article starts with too many inaccuracies to recommend it to anybody: - Teletypes were designed about a century before the era of mainframes. - Mechanical teletype did not have an "I/O driver" in it. - OS on Mainframe computers did not have a "Kernel", and neither "I/O driver", "Line discipline" or "TTY driver". This model was introduced with UNIX, the OS that ran on minicomputers. - Was ChatGPT used to write th…

That's quite an unnecessarily toxic comment, besides all your criticism seems fixated with the introduction on teletypes.

I enjoyed the blogpost, I trust the authors of a terminal emulator to give me a good overview on the topic and I enjoyed it.

Re: What happens when you open a terminal and enter `ls’

#30
post #26

ls is not recognized as an internal or external command, operable program or batch file. ;-)

Haha, yeah we probably should have added a caveat that this is only applicable to Unix

I assumed so, but then I got curious what would happen in a DOS window.
Post reply on HN