I've noticed, that all mate-terminal instances I start, be it inside a mate-terminal or via a link button, have the same PID.
For example, I got something like
$ wmctrl -lp
<omitted lines that don't matter>
0x03c0001f 1 7411 <hostname> Terminal
0x03c06b9f 1 7411 <hostname> Terminal
0x03c07349 1 7411 <hostname> Terminal
0x03c073f4 1 7411 <hostname> Terminal
0x03c0749f 1 7411 <hostname> Terminal
0x03c0754c 1 7411 <hostname> Terminal
0x03c075f9 1 7411 <hostname> Terminal
0x03c076a6 1 7411 <hostname> Terminal
0x0340000b 1 <pid1> <hostname> xeyes
0x0460000b 1 <pid2> <hostname> xeyes
which clearly shows that there are multiple Terminal windows, all with the same PID. As stated above, it didn't matter, whether or not the process was started inside a terminal or by clicking a menu bar link. Neither did it matter, whether or not I started the process in the background inside the terminal.
What is the applied rule here, or "why is this so"?
My understanding used to be that every command I start in a shell would obtain a unique PID.
Isn't it kind of impractical to have multiple terminals with the same PID?
I can't kill them individually by PID anymore.
Edit: Kernel version: 3.16.0-4-amd64
xeyes
andmate-terminal
s run from, say a menu bar link also creating processes under the same PID? In that case, themate-terminal
s are not called from the first one. Also,xeyes
can't call any otherxeyes
processes, can it (?) – polynomial_donut Aug 31 '15 at 06:14mate-terminal
, it contacts the existing process, no matter where you ran it from: the secondmate-terminal
process is not the one that displays the window, it just sends commands to the existing one and waits for the first one to tell it that the window was closed. If you runxeyes
twice, you get two different processes. You can see it in the window IDs: they encode the client connection to the X server, and there's usually one per process. All the Mate Terminal windows in your wmctrl output come from connection 0x03c. The xeyes windows come from connections 0x034 and 0x046. – Gilles 'SO- stop being evil' Aug 31 '15 at 07:32xeyes
. Somehow I didn't catch that properly, was probably too tired x_X Can you maybe elaborate on "connections"? If you don't mind... – polynomial_donut Sep 02 '15 at 22:13