-1

terminals were once real physical devices for sending input and receiving output from a mainframe computer. The shell was not a real physical device from the start, but the same what it is today, a command interpreter, a processes running inside the mainframe computers' ram.

Why would one even consider to turn those physical devices into processes which run alongside the shell in the ram?

Basically we evolved from:

  • physical input/output device and computer

to

  • physical input/output device (keyboard/monitor) and emulated former physical input/output device (terminal) and computer

Why? How does it make any sense to evolve from dualism to a kind of inbetween dualism and trialism (if the word exists)?

sharkant
  • 3,710
  • 1
    Instead of re-using the existing infrastructure, you would suggest doing what? Remember that your solution would have to support physical terminals that are still in use today. – Kusalananda May 25 '17 at 18:24
  • 1
  • i do not judge whether it makes sense or not, I just explain my limited point of view and hope to get it widened...so you suggest it is connected to history of infrastructure and this probably means that if all computers vanished from the earth and had to be rebuilt from the scratch there would be no need for an emulated terminal? – sharkant May 25 '17 at 18:26
  • 2
    Pretty much, yes. If the evolution of computers was re-played, but skipped "dumb terminals" somehow, things may well end up looking quite different. – Kusalananda May 25 '17 at 18:49
  • saga gave a good answer, he explained, that shells simply have not the routines for input and output, only command interpretation, and this function is realized by emulated terminals. Do you know how they communicate with each other, is one the parent process of the other or are they communicating as independent processes? – sharkant May 25 '17 at 19:27
  • In someways Plan9 agrees with this! Read: docs.huihoo.com/plan9/Plan9.pdf. Infact, Acme editor doesn't have a terminal emulator. – Nishant Jul 13 '20 at 09:31

1 Answers1

3

As kusalananda says in the comments, we still use terminal emulators because we don't have an alternative.

This trialism is observed only in unix based systems. You can live on a windows machine for years without ever opening a dos prompt.

I guess the reason terminal emulators are still a thing today(in unices at least) is because we haven't found a better way to use the shell interactively. And shell is a very useful part of unix based os's. You can't program your mouse to do stuff you find yourself doing again and again(well you can, but it's not nearly as elegant as the shell).

So, the terminal emulators will be around till the day we find a better way to communicate with the shell, or an alternative to the shell itself.

saga
  • 1,401
  • thanks, this answer was really an eye opener, so if I got you right, the shells we have nowadays for linux simply have not the input output routines implemented and therefore the the terminals got emulated to fullfill this function? So, when both are for this reason determined to work together, is one of them, eitther shell or terminal the parent process of the other or do they communicate on peer level as processes? – sharkant May 25 '17 at 19:24
  • 1
    The terminal is the parent. When you login, getty sets the value of env variable SHELL, the terminal(vt or emulator or the driver of a real one) sets up communication paths and forks the shell process. See the source of st(simple terminal) for details. v-0.1 is less than 2000 lines of code. – saga May 25 '17 at 19:51
  • what is the "source of st(simple terminal)" ? Is this a man page? – sharkant May 25 '17 at 19:58
  • 1
    I mean the source code of st, it's only a single file of c code: st.suckless.org . It's a minimal terminal emulator. – saga May 25 '17 at 20:18
  • You can also live on a Linux machine for years without opening a terminal. And conversely you can do things from the terminal on Windows (as long as you install a third-party terminal emulator and a third-party shell that don't suck). – Gilles 'SO- stop being evil' May 25 '17 at 23:01
  • In defense of Windows, there are headless servers now and I expect that there will be more to come in the following years as powershell matures and more administrators learn that it is useful – cutrightjm May 26 '17 at 04:08
  • +cutrightjm Last few years suggest that microsoft is heading in a new direction. Last year I installed windows 10 and the installer didn't mess up linux efi partition! – saga May 26 '17 at 05:28
  • +Gilles Yes it's possible with distros like ubuntu, but things break from time to time and every tutorial about fixing linux system involves typing some comands in a terminal. It's good though, so much better than windows recovery tool. – saga May 26 '17 at 05:36