What is the exact difference between a terminal, a shell, a tty and a console?
unix.stackexchange.com
unix.stackexchange.com
(I'm only 33 and having get those kids off my lawn moments...)
You have laymen with emulators on their telephones. It shouldn't be a hard concept to teach.
TTY, of course, stands for Teletype, which was a common terminal used in the early days of Unix. In the old days, you'd talk about having a whole room full of TTYs. Now, it seems to refer to the emulated terminals provided by a Unix-like system.
A console would originally be a specific terminal (often hard-copy, like a Teletype) hooked directly to the computer for administrative tasks.
https://secure.wikimedia.org/wikipedia/en/wiki/Telecommunica...
Now, I'm all for a "History of Computing" class being required for CS, but that's another story. I also wish that I had time during undergrad for a "History of Biology/Chemistry/science/alchemy" class (I was a biochem major).
"The rationale for the differences between them are mainly historical and not really a good design."
The separation of shell, a terminal emulator, and a psuedo-terminal is bad design? Really? I would love to see a rationalization for that. EDIT: Or downvotes will work fine as well I suppose.
I wouldn't be noticing that many people don't understand the concepts if it were not relevant to these people. It's not like these are particularly deep subjects either, people directly interact with 2 of the 3 every day. They're not buried details, they're frontline human-computer interfaces.
P.S. Understanding cars is very similar to understanding computers. There are numerous layers of abstraction in place that allow us to rope off areas of understanding for later. I would argue that there is actually more information to learn about cars than there is computers for a few reasons: 1) cars are jam packed full of computers these days. 2) there are half a dozen engineering and science disciplines involved in cars off the top of my head, and that number is only limited by the number I know the name of. 3) (depending on if we're pulling in computing hardware into the discussion or not..) cars are things built in the real world with imperfect knowledge of all the systems that go into them. You can be sure people a century ago were not paying a ton of attention to fluid dynamics in engine cylinders. You can always dig deeper into what is actually going on.
My point is here is that if computers are more complicated than cars, it's not by much. I believe my comparison holds.
Sure there should be layering, but starting by emulating a serial port to create an ssh session? Why is this in the kernel not in userspace?
The reasons ttys and ptys are in kernel space are numerous. As one example, it needs to be there because different line disciplines are necessary and relying on a userspace program to implement them will not do. Ever notice how su/sudo/passwd/etc don't echo your password? Yeah, that sort of important. Furthermore, ttys in modern systems are tied to job control rather deeply. Implementing correct signal sending, sessions with controlling terminals, forground/background processes, etc in userspace? Have fun.
I could write a book on this subject, but this is easier: "Write a fully functional pty in userspace. If you ever manage to get that far, then compare your work with traditional implementations and defend it."
PS: ptys are not "emulating" anything in any meaningful sense of the word.
"And do we really need the job control model as is?"
Yes.
Anyway, the distinction is only important in very narrow cases. I've heard people say "Open a new terminal", "Open a new command window", "Open a new shell", and "Open a new console". They mean the same thing in this context. The contexts where they don't and where that fact needs to be spelled out don't come up very often. This unwarranted attention to detail is analogous to changing a flat tire with a friend by saying: "Hey, grab the spare wheel out of the trunk" vs. "Hey, grab the spare tire out of the trunk". This whole thread is like seeing that there are technical differences between a wheel and a tire in the context of a repair shop, but in the context of "get me the circular thing from the trunk that I can attach to my damn car to make it go again" they're the same, and then complaining when people use the second context and don't keep the terms distinct.
And say you had this problem, guess what is not going to work? "I have a problem with my command window", "I have a problem with my console", "I have a problem with my TTY".
This is why vocabulary is important.
Wikipedia is sorely lacking in this critical detail.