When listed down the running processes, I can see several processes like 'chrome', 'notepad', 'intellij', 'sublime editor' etc.. are having "tty = ?"
- Then how are they able to read the input from a keyboard?
- Is TTY always related to terminals/cli?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
XWindows applications receive keyboard and mouse input from the X Server, and display things through the X Server. It is unusual for these applications to have a controlling terminal (the tty column) unless they are started from a command line that has a controlling terminal.
There are really only a few XWindows applications that need a controlling terminal or input or output redirection. Amongst them are
xlsatoms. Of those, only one displays a window and three can temporarily change the cursor.
It is actually more common for an XWindows application to host a tty.
xterm and every other terminal application provides a tty to the shell or other programs running "inside" it.
Finally, note that the X Server itself usually DOES (at least in Linux) have a terminal associated with it. This is more so that it can fit into the virtual consoles than anything else, but it does allow the keyboard and mouse to be switched between the X server and the other virtual consoles.