I noticed that when I have xnethack running, wmctrl interacting with
GNOME shell is not able to associate xnethack with a process ID and so
there is a Perl minor warning emitted about the process table entry
being uninitialised.
I'm not sure what the best way to deal with this is nor where issue
leading to the PID being zero is located, but I think the Perl warning is not ideal. Since the process table entry is only being used to update a progress bar, perhaps an uninitialised one can be ignored.
$ wmctrl -l -p | grep nethack
0x00a00054 0 0 chianamo nethack-x11
$ pgrep -a nethack
9175 /usr/lib/games/nethack/nethack-x11
$ which xnethack
/usr/games/xnethack
$ file /usr/games/xnethack
/usr/games/xnethack: symbolic link to ../lib/games/nethack/nethack-x11.sh
$ file /usr/lib/games/nethack/nethack-x11.sh
/usr/lib/games/nethack/nethack-x11.sh: POSIX shell script, ASCII text executable
$ grep ^HACK[A-Z]*= /usr/lib/games/nethack/nethack-x11.sh
HACKSTYLE=x11
HACKDIR=/usr/lib/games/nethack
HACK=$HACKDIR/nethack-$HACKSTYLE
$ ls -l /usr/lib/games/nethack/nethack-x11
-rwxr-sr-x 1 root games 2.4M Jun 26 2016 /usr/lib/games/nethack/nethack-x11*
$ needrestart-session
Use of uninitialized value in subroutine entry at /usr/lib/needrestart-session/needrestart-x11 line 176, <HPIPE> line 3.