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.

0
votes
0answers
47 views

Is controlling terminal a per-process concept?

The Linux Programming Interface says The ioctl(fd, TIOCNOTTY) operation can be used to remove a process’s association with its controlling terminal, specified via the file descriptor fd. ...
0
votes
0answers
112 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
1answer
67 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
1answer
123 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?...
7
votes
1answer
369 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 ...
0
votes
1answer
75 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 ...
-3
votes
1answer
99 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 ...
7
votes
3answers
1k 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
0answers
46 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
1answer
556 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 ...
2
votes
1answer
894 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. ...
3
votes
0answers
143 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 ...
11
votes
2answers
3k 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 ...
2
votes
0answers
343 views

How do I assign the controlling terminal to other process?

I use TIOCSCTTY to forcibly take over the controlling terminal in other "remote" application. But after the application finishes running, controlling terminal gets orphaned and bash stops reacting to ...
8
votes
2answers
6k views

Invoke a command/script disconnected from the controlling terminal?

I'm investigating the behaviour of a script that is normally run as an automated process (e.g. cron, Jenkins). The script can (eventually) invoke commands that behave differently (seeking user input) ...
12
votes
4answers
81k views

Please explain this output of ps -ef command?

A part of the output from the ps -ef command is given below : UID PID PPID C STIME TTY TIME CMD root 1 0 0 2012 ? 00:00:01 init [3] root 2 ...
17
votes
2answers
5k views

Concept of controlling terminal in Unix

Can some one please explain in an easy to understand way the concept of controlling terminal in unix and unix like systems ? Is it related to a session ? If yes, then how ?