Questions tagged [controlling-terminal]
The "controlling terminal" is an attribute of a process that identifies the terminal device that affects it with regards to "job control". It typically affects processes that run inside a terminal or open a terminal device.
19 questions
2
votes
1
answer
367
views
Why can't bash map ^C to intr signal if invoked as init?
If I make the bash as the first process invoked (i.e as init), as a result it will display the following:
init: cannot set terminal process group (-1): Inappropriate ioctl for device
init: no job ...
11
votes
2
answers
4k
views
How can I redirect the output of a C program from /dev/tty to /dev/null?
Consider this sample C program which writes to /dev/tty and doesn't have command line options to make it not do so.
#include <stdio.h>
int main (void) {
FILE* fout = fopen("/dev/tty&...
3
votes
0
answers
615
views
Controlling terminal of a display server
When I login on a Fedora 31 workstation and run the ps command, I see the below output;
for an X session:
PID TT CMD
...
1 ? /usr/lib/systemd/systemd --switched-root --system --deserialize ...
0
votes
1
answer
931
views
For a non-controlling process, is `ioctl(fd, TIOCNOTTY)` the same as `close(fd)`?
Assume a session has a controlling terminal.
If a process in the session that is not the session leader, calls ioctl(fd, TIOCNOTTY), is it correct that it only closes the fd for itself? Is it the ...
1
vote
2
answers
331
views
Can a (non-)controlling process detach its controlling terminal by closing its file descriptor?
In a process session with a controlling terminal,
if the controlling process closes the file descriptor of the controlling terminal, does the process session become detached from the controlling ...
-2
votes
1
answer
373
views
Does an X client process always have one or more GUI window(s)?
Does an X client process always have one or more GUI window(s)?
Conversely, if a process has one or more GUI window(s), is it an X client process?
Does an X client never have a controlling terminal?...
9
votes
2
answers
3k
views
what relations are between my current controlling terminal and `/dev/tty`?
On Lubuntu 18.04, I run a shell in lxterminal. Its controlling terminal is the current pseudoterminal slave:
$ tty
/dev/pts/2
I would like to know what relations are between my current controlling ...
1
vote
1
answer
524
views
When a session leader acquires a controlling terminal, how would the other existing processes in the session also acquire the controlling terminal?
Suppose there is a session with multiple processes in it and without a controlling terminal.
When the session leader creates a connection to a controlling terminal,
how would the other processes in ...
-3
votes
1
answer
466
views
Does a shell automatically connect file descriptors 0, 1 and 2 to its controlling terminal?
From The Linux Programming Interface
In an interactive shell, these three file
descriptors 0, 1 and 2 normally refer to the terminal under which the shell is running.
Does "the terminal ...
9
votes
3
answers
3k
views
Background, zombie, daemon and without ctty - are these concepts connected?
How these process concepts are related together - background, zombie, daemon and without controlling terminal?
I feel that they are somehow close, especially through the concept of controlling ...
2
votes
0
answers
70
views
Is `controlling terminal` solely for user control?
I can kill processes and send signals to them with kill, so I don't need controlling terminal (or ctty) for that. So.. is the purpose of controlling terminal is solely for reacting to nudges from user?...
4
votes
1
answer
2k
views
Process without a controlling terminal
What happens with process when it is run without a controlling terminal? How is that process different from a standard processes? What features does it lose and what does it acquire?
UPDATE #1
The ...
3
votes
1
answer
3k
views
Does keyboard input always go through a controlling terminal?
Am I right that all input typed from the keyboard goes through a controlling terminal? That means that if a program is run without a controlling terminal, it won't be able to receive any user input. ...
4
votes
1
answer
625
views
List all processes without controlling terminal (only)?
Is there a portable way to do this?
On Linux, I can use ps a -N
but this option isn't available on other (POSIX) systems.
Of course I can use grep '^?' with, say, -o tty,... but is there something ...
16
votes
2
answers
6k
views
How to get the real name of the controlling terminal?
How can one get the real name of the controlling terminal (if there is one, else an error) as a pathname?
By "real name", I mean not /dev/tty, which cannot be used by other arbitrary processes to ...