On X startup the following is ran automatically:

xterm -e screen -rS app1

This opens up an xterm session and attaches the screen of app1, which was already running in a detached state.

What I'd like to achieve is the ability to close the xterm window, using ctrl-c, without terminating app1 running under screen. The current behavior with ctrl-c is that xterm closes along with app1 and the screen session.

I know of C-a d but I'm looking specifically for ctrl-c.

1 Answer 1


Ctrl-C is the default interrupt character, it causes the appropriate interrupt signal (SIGINT) to be sent to the running process. Probably, your application doesn't handle it, but terminates (which is the default action), and both screen and the xterm exit after that, since nothing is running within them.

You could see if the application can be made to ignore the signal, or disable the interrupt character from the terminal (stty intr "") to prevent the application from exiting.

That wouldn't detach the screen, though. But you can achieve that by binding detach to Ctrl-C in screen, with bindkey ^C detach. (Either in your .screenrc or given with ^A: in screen.) Note that the command is different from the usual bind, that one controls the command key sequence bindings, the ones that use the ^A prefix (or whatever you set it to).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .