Working on this answer, I found out that the output of ps commands has quite changed in 15.04.
A few examples
in 14.04, the output of ps -e shows on gnome-terminal:
$ ps -e
19006 ? 00:00:00 gnome-terminal
while in 15.04:
$ ps -e
24959 ? 00:00:00 gnome-terminal-
(mind the 15 characters)
Curious to the long version, I ran ps -e ww:
In 14.04:
$ ps -e ww
19006 ? Sl 0:01 gnome-terminal
while in in 15.04
$ ps -e ww
24959 ? Rl 0:01 /usr/lib/gnome-terminal/gnome-terminal-server --app-id com.canonical.Terminal.qVQkBaeWjRVoRiJKYQVkNNyrboXUfVrj
looking for the application, corresponding to the pid:
In 14.04:
$ ps -p 19006 -o comm=
gnome-terminal
while in 15.04:
$ ps -p 24959 -o comm=
again the 15 characters (as expected):
gnome-terminal-
In the linked question, I solved it by deriving the application name from the WM_CLASS, as mentioned in the output of the xprop command. I would prefer however to use the "old fashioned" ps -p 19006 -o comm=, which is more efficient.
These differences have quite some consequences for usage in scripts. My question is: does anyone have information on what is the reasoning behind this or what it is caused by?