After modified screenrc, how to see the changes without restarting screen?
4 Answers
I tried the option mentioned here - Ctrl-a : source ~/.screenrc and it didn't work for me.
This is what worked for me - Ctrl-a : source $HOME/.screenrc
- 491
-
-
@Iain I know, ideally it should. I guess something was wrong with my ENV then. Nevertheless, it worked. – holydevil Dec 13 '11 at 10:41
-
-
-
4
-
I tried ~/.screenrc on a old gentoo box and it didn't work. I changed directory to my home and used
source .screenrcand it worked fine. Something about the tilde for home I suppose. – kevingreen Aug 16 '17 at 14:08 -
I have this in my .screenrc file:
bind R eval "source $HOME/.screenrc" "echo '.screenrc reloaded!'"
Which causes screen to reload the .screenrc file when Ctrl-AShift-R is pressed.
Of course, this only works if you've already got the line in your .screenrc file! To 'bootstrap' this sortcut on an existing screen session, add the line above line to your .screenrc file and then follow @Dennis Williamson's answer. After that, you'll be able to use the new keyboard shortcut.
- 321
-
1This is brilliant. Is there anything that can be added to the command to stop the reload from opening additional windows? I have .screenrc configured to automatically start two shell windows on startup, so reloading .screenrc continually opens two new windows. – Jesse Schoff Nov 11 '19 at 16:19
The Ctrl-a : source ~/.screenrc (or variants) mentioned by others are indeed "the way to go".
But if you are using a frontend for screen (e.g. byobu), a bit of extra work is needed:
- Open a new terminal
- Attach the screen here too:
screen -x - Run Ctrl-a
:source ~/.screenrc(like everyone suggested) - Detach the screen: Ctrl-a d
- Stop the new terminal:
exit
The settings are now applied everywhere this screen is attached, no matter what frontend you are using. (Even when using no frontend at all)
- 183
source. – Dennis Williamson Oct 25 '10 at 19:36You could edit the file to comment out the commands that create thew new windows/layouts; source the file; and then un-comment those lines. Of course, if it's the window creation you're wanting to test, you don't have much choice here...
– James Polley Oct 25 '10 at 22:46sourceit from.screenrc(which will contain your screen creation instructions) for regular startup and when you need tosourceit again afterscreenhas already started, just do "ctrl-a : source secondary-file" to skip the screen-creation stuff. – Dennis Williamson Oct 25 '10 at 23:53permission deniedto ~/.screenrc when I have.screenrcas a symlink. Does any body face it? – FelikZ May 22 '15 at 12:20