0

I would like to exit my active screen session and kill (not detach) the session.

This is done with CTRL + a and then k, however screen then then prompts you "Really kill this window [y/n]" and you have to respond with y to kill the session.

Is there a way to do this without having to confirm with y ?


Note: Screen is being used to connect to a physical console TTY session so I cannot just type "exit" to kill the session. (ex: screen /dev/ttyUSB1 9600)

Rino Bino
  • 511
  • 5
  • 21
  • just type `exit` – Esther Jun 29 '22 at 16:47
  • That doesn't apply to my situation, I'm using screen to access a physical ttyUSB console session. There is no "exit" it's just sitting at a login prompt as-if I'm physically at the machine. – Rino Bino Jun 29 '22 at 17:23

1 Answers1

2

CTRL + A followed by : (to enter command line mode) and then kill appears to kill the current screen window without further prompting.

If you add something like this to your .screenrc you can do CTRL + A followed by E and then hit enter.

bind e colon kill

You may in fact be able to get that to auto-submit, if you change the line like this:

bind e colon "kill\015"

Where \015 is the octal representation of CR (carriage return). You may still get the Window X (...title...) killed notification but the screen window will be gone without further keys needing to be pressed.

Erwin
  • 136
  • 3