Sunday, June 05, 2005

GNU Screen

GNU Screen enables you to work in multiple sessions in single a telnet/ssh sesion. After you have installed it :

- run screen. Now you are presented still in your shell prompt as usual. Ctrl-a c will create another new session.
- Ctrl-a " will list all your session. Use arrow key to select one, enter to goes to that session.
- Ctrl-a A will prompt you a name for the current session.
- Ctrl-a w will shows you some info of all sessions.
- Ctrl-a Ctrl-a toggles between current and previous session.
- Ctrl-a d will detach the curren screen sessions, and goes back to your original shell prompt. In fact if you are in a remote terminal, just close your terminal emulation app will achive the same effect. After detached, screen -ls will list all the detached sessions. screen -r will restore the first one. screen -d -r will try to detach the session, then attach it. (Good for detaching the session from another remote terminal, and steal it to current one). Think about it, it's really handful!
- For help, Ctrl-a ?
- Hint: If you usually set your bash setting in .bash_profile, you can make a symbolic link of .bashrc back to this file. This way, when screen invokes bash, it will read back your profile setting.
- Hint: If you see ~ appearing when pressing backspace key, it means your terminal emulator is setting wrong. For PuTTy, change it to Ctrl-H.

No comments: