How to prevent screen from terminating when command in window terminates
Solution 1:
You can enter the zombie kr
command after typing Ctrl-A:, to make a running screen
keep the window open after the command finishes. The kr
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.
Solution 2:
Can't you just start screen first and run fsck inside your screen session?
Anyway, add this to your ~/.screenrc
:
zombie kr
verbose on
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 hit ctrl-A <esc>
to enter the screen scrollback mode and browse back in your previous output.