0

Is the CLUI (Command Line User Interface) and GUI (Graphical User Interface) utilize different TTYs or both of them share the same TTY?

I understood in the past that they both share the same TTY but I might be wrong. I got a bit confused when reading about that and saw different phrasings that made see the CLUI/GUI-TTY issue a bit confusing one.

I understand what is a TTY machine from history (60s/70s) but don't know if a modern virtual TTY "bases" both CLUI and GUI, or if there is TTY one per each (one for CLUI and one for GUI), and my question is if there really is.

Update due to Sparhawk's comment:

By CLI I mean to either the CLUI I run from my GUI-including-distro (like the Debian desktop CLUI) or my other no-GUI distro, like the Debian server CLUI or Ubuntu WSL.

  • 1
    It depends what you mean by a "CLI". Is that a terminal emulator that you run within your desktop environment? Or one that you run on… uh… a different tty? There's also some reading here that might clear up some of your confusion. – Sparhawk Nov 13 '17 at 05:17

1 Answers1

1
  • CLUI: command line user interface
  • GUI: graphic user interface

These things mean what they mean, no more.

These definitions don't include anything about a tty. For example, the cmd.exe on windows is also a CLUI, although it doesn't use any tty device (it is conceptionally nonexisting on Windows).

Tty means a virtual teletype console writer, which is the traditional name of the pseudo virtual terminals on the Unixes. By default (after boot), a character console runs on them, but you can connect anything to them.

The best thing to understand the ttys, if you think on them as network sockets: Processes can listen on them, and also connect them. In addition, there are various kernel APIs for the user interaction: for example, if a virtual terminal closes unexpectedly, changes its size, activates or deactivates, then the processes attached to them, get different signals. It is up to them, what they do with it.

For example, an X server running on tty7, if you switch to character console (alt/ctrl/f1), then it deinitializes the video card and switches back to character mode. Other processes, for example, a command shell, can totally different things.

peterh
  • 9,731