I recently accidentally selected 'Exit Ctwm' instead of 'Restart Ctwm' in a
menu. It did not kill X because I have a little program running that has to be
killed to end X.

But I was stuck because none of the visible windows allowed me to give a command
to re-start Ctwm. Fortunately, because it was linux I was able to Ctrl-Alt-F2
to get a login prompt and then define $DISPLAY and run ctwm (actually ctwm &).

I wonder if there is any way to give ctwm the option to always start a new
terminal window guaranteed to be on top, before it exits. Something like

 Function "OnExit"
 {
     f.exec "xterm &"
     f.quit

 }

Always invoked on exit (but not in the call of f.quit).


For now I am experimenting with this messy solution:

 # Start a new xterm then exit. The xterm will allow commands to be given.

 Function "xtermexit"
 {
     f.exec "xterm &"
     f.quit
     ## Kill ctwm. May abort whole session

 }

with menu item:

    "XtermExit"               f.function "xtermexit"

So selecting that menu item launches an xterm and kills ctwm.
So far the new xterm has always come out on top.

This is not a general enough solution because it is still possible to kill ctwm
accidentally and the xterm will not be launched.

But I can survive for now!

Thanks.

Aaron

Reply via email to