1

I'm using Cygwin to start some servers.

Each server is launched inside an xterm with a bunch of command like this one:
xterm -e $my_cmd /C &

Is there an easy way to kill all launched children (xterm and their running commands) in a row ?

I want also to be able kill a particular launched command when I close its parent xterm.

Someone knows how to perform that ?

Guillaume
  • 5,488
  • 11
  • 47
  • 83

1 Answers1

1

killall xterm? That command is in the psmisc package. Xterm will notify its child process with a SIGHUP ("hangup") before it exits. Normally that will cause the child process to exit too, although some servers interpret that signal differently.

ak2
  • 6,629
  • 31
  • 27
  • killall xterm is too violent: that kills other xterm that should be left alone. And the children processes re not killed... – Guillaume Oct 08 '10 at 08:59
  • In that case I guess you'll need to write a script that combs through `/proc` to find the appropriate processes to kill. – ak2 Oct 09 '10 at 21:04
  • Oh, and you did ask "Is there an easy way to kill *all* launched xterm". – ak2 Oct 09 '10 at 21:12
  • yeah, I fix it ;).But my title is: Kill all processes launched inside an xterm when exit – Guillaume Oct 11 '10 at 08:45
  • Is it possible to kill a node-pty process and respawn a new node-pty terminal? – zero_cool May 09 '21 at 05:36