I can accept an extra application to communicate between the WM/terminal and the shell.
I do not need to identify the terminal/console type, but the window ID, so I could do some action on the window. The PS way does not simply work with gnome-terminal. The shell is a subprocess of terminal service, not the window itself.
OS: Artful.