0

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.

Magicloud
  • 458
  • I'm probably missing what you're after, but echo \ps | tail -n 1 | awk {'print $2'}`` does what I understand your subject is asking... – guiverc Feb 20 '18 at 05:35
  • 1
    @guiverc the echo and backticks are superfluous in that pipeline, and I would prefer the tty coreutil for that. But I agree that we may be missing exactly what OP is asking. What does to "know the terminal window" mean? – zwets Feb 20 '18 at 06:33
  • As it happens I recently wrote an answer about that… – dessert Feb 20 '18 at 07:42
  • 1
    @guiverc Also as PIDs wrap around as they reach their maximum value, there's absolutely no guarantee that the last printed line would be any relevant. – egmont Feb 20 '18 at 20:00

0 Answers0