Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer
    
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
up vote 0 down vote accepted

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 ','`"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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