Is there any way to make GNU Screen not close if I end all its subprocesses? Ideally, it would create a new window running a shell if I accidentally closed the last window.
2 Answers
Assuming you're using bash and accidentally closes the shell with Ctrl-D, you can
export IGNOREEOF=1
This will give you a warning and require you to press Ctrl-D twice, or type exit instead.
-
3Thanks! I added this to my
~/.screenrc:setenv IGNOREEOF 10/screen -t main bash/unsetenv IGNOREEOFP-Nuts– P-Nuts2011-06-24 15:40:37 +00:00Commented Jun 24, 2011 at 15:40 -
1+1 because there's no part of my life that hasn't been improved after learning that!EightBitTony– EightBitTony2011-06-24 16:09:23 +00:00Commented Jun 24, 2011 at 16:09
-
1I did some more investigation and if you search for "Suddenly the Dungeon collapses!!" in attacher.c, it should be possible to change the code to spawn a new window somehow, instead of shutting down the whole thing. The source is just one quick git clone away: git://git.sv.gnu.org/screen.gitAlexander– Alexander2011-06-24 16:47:05 +00:00Commented Jun 24, 2011 at 16:47
-
1Haha! I don't really want to go to the effort of maintaining my own patch to Screen, but thanks for reminding me of the Nethack option. (Though I was more of an Angband man myself...)P-Nuts– P-Nuts2011-06-24 22:18:52 +00:00Commented Jun 24, 2011 at 22:18
-
Accidental terminal cloures was a huge annoyance for me. Added
set -o ignoreeofto ~/.bashrc; works in konsole | xfce4-terminal | ...Victoria Stuart– Victoria Stuart2018-04-19 20:16:38 +00:00Commented Apr 19, 2018 at 20:16
I don't know of a way to do that specifically, but I find zombie {} useful; when I close a window, it prompts me to hit { or } to close or reopen it, respectively.
-
can this be used without having a screenrc?Janus Troelsen– Janus Troelsen2015-07-18 09:04:10 +00:00Commented Jul 18, 2015 at 9:04