When I start a graphical application from a terminal running bash, that application is somehow connected to that bash session. For example, when the applications dumps some text it will appear in the bash session it is started from. Also, some applications will get closed when i close the terminal using the close button, but not when i close the terminal by exiting the bash session using the exit command or CTRL+D.

How is a graphical application started from a bash session connected to that bash session?

bonus question: How can I inspect this connection? probably also manipulate?

2 Answers 2


The application is connected in two ways: to bash, and to the terminal.

The connection to the terminal is that the standard streams (stdin, stdout and stderr) of the application are connected to the terminal. Typical GUI applications don't use stdin or stdout, but they might emit error messages to stderr.

The connection to the shell is that if you started the application with foo &, it remains known to the shell as a job, as explained in Difference between nohup, disown and &. When you close the terminal, the shell receives a SIGHUP, which it propagates to its jobs. When you type exit in the shell, it disowns the jobs beforehand (this is configurable to some extent).

You can sever the shell connection with the disown built-in. You can't sever the terminal connection, at least not without underhand methods (using a debugger) that could crash the program.


Your shell starts these programs as child processes. If you run pstree you can see these relations. I don't know if/how you can manipulate it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .