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?

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.

4
  • The problem ist not to kill the window. I can type exit into the terminal and the window is gone. But I need Alt+F4 and the "close" entry in the menu to work – Alexander Stolz Apr 20 '12 at 10:01
  • @AlexanderStolz Can you update your question with the relevant parts of you mwmrc? – utopiabound Apr 20 '12 at 12:42
  • What do you mean by relevant parts? – Alexander Stolz Jul 10 '12 at 12:50
  • When I use this in my .mwmrc it prompts me to select a window to kill which I don't want – Alexander Stolz Jul 16 '12 at 14:11
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 ','`"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.