2

I have an tcl script running in MWM and it starts xterm terminals with:

 .menu.utils.m add command -label {Xterm} -command {
        exec xterm -sb -T "Xterm" -sl 10000 -e su - int &
  }

Doing this, the terminals can't be closed using Alt+F4 or the Menu bar. Is there a way to fix this?

2 Answers2

1

Have you tried using xkill? That will destroy the window, though it will leave behind the su process and it's children. You can try to Ctrl-C in the xterm to kill the process. Or if it's actually an xterm process (and not gnome-terminal or some such) you can Ctrl-Left-Click and send a KILL (or other) signals to the child process.

UPDATE I think you could add something like this to your .mwmrc:

Keys MyKeyBindings
{
    Alt Shift<Key>F4     window   f.exec "xkill -id <WM_CLIENT_LEADER>"
}

The reason that f.kill and Close in fvwm doesn't close an xterm -e su - is because the xterm can't end the sub-process. So to get the Window Manager to end the xterm it needs to be destroyed and not politely asked to close.

utopiabound
  • 3,304
0

So what I ended up doing in the end was finding the focused window and xkilling it in the following way:

 f.exec "xkill -id `xdpyinfo | grep focus | awk '{print $3}' | tr -d ','`"