When running 'screen ls' the screen stops with the text [screen is terminating]
. I would like screen to keep the session alive and reattach to it to see the output of ls
.
Of course the real thing is that I don't run screen ls
, but rather a screen fsck ...
, so I would like to ensure that the screen is not terminating when this command is finished.
I would love to have an answer that is useful for an already existing running screen session, so some interactive keys like C-a ...
or C-a :
(Enter command line mode)
You can enter the
zombie kr
command after typing Ctrl-A:, to make a runningscreen
keep the window open after the command finishes. Thekr
part is specifying what keys you want to use to control the window after its command has finished -- in this case, "k" to kill/close the window, or "r" to restart the command.Can't you just start screen first and run fsck inside your screen session?
Anyway, add this to your
~/.screenrc
:and then screen will leave your zombie session open. You can then hit
r
to resurrect your session although in this case it will just run your command all over again which you probably don't want. Probably what you want to do is then hitctrl-A <esc>
to enter the screen scrollback mode and browse back in your previous output.