zxxx大佬:
按照说明弄成功了,真的很好用。
出处:http://taint.org/wk/RemoteLoginAutoScreen
在 ~/.bashrc 文件开头添加
- # Auto-screen invocation. see: http://taint.org/wk/RemoteLoginAutoScreen
- # if we’re coming from a remote SSH connection, in an interactive session
- # then automatically put us into a screen(1) session. Only try once
- # — if $STARTED_SCREEN is set, don’t try it again, to avoid looping
- # if screen fails for some reason.
- if [ "$PS1" != "" -a "${STARTED_SCREEN:-x}" = x -a "${SSH_TTY:-x}" != x ]
- then
- STARTED_SCREEN=1 ; export STARTED_SCREEN
- [ -d $HOME/lib/screen-logs ] || mkdir -p $HOME/lib/screen-logs
- sleep 1
- screen -RR && exit 0
- # normally, execution of this rc script ends here…
- echo "Screen failed! continuing with normal bash startup"
- fi
- # [end of auto-screen snippet]
新建 ~/.screenrc 文件
- # see http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html
- # support color X terminals
- termcap xterm ‘XT:AF=\E[3%dm:AB=\E[4%dm:AX’
- terminfo xterm ‘XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX’
- termcapinfo xterm ‘XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX:hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007’
- termcap xtermc ‘XT:AF=\E[3%dm:AB=\E[4%dm:AX’
- terminfo xtermc ‘XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX’
- termcapinfo xtermc ‘XT:AF=\E[3%p1%dm:AB=\E[4%p1%dm:AX:hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007’
- # auto-screen support; see http://taint.org/wk/RemoteLoginAutoScreen
- # detach on hangup
- autodetach on
- # no startup msg
- startup_message off
- # always use a login shell
- shell -$SHELL
- # auto-log
- logfile $HOME/lib/screen-logs/%Y%m%d-%n.log
- deflog on
注: 如果你只想要自动运行 Screen 功能,中间的7行是最重要的部分;
如果愿意,您可能可以省略 “color X terminals” 和 “auto-log” 节,也即
~/.screenrc 文件
- # auto-screen support; see http://taint.org/wk/RemoteLoginAutoScreen
- # detach on hangup
- autodetach on
- # no startup msg
- startup_message off
- # always use a login shell
- shell -$SHELL
h20大佬:
请教下screen滚走的怎么翻回去看?
zxxx大佬:
请教下screen滚走的怎么翻回去看?
这个真不知道。我的要求就是断线重连恢复现场,就像没有断开一样。
论坛大师大佬:
请教下screen滚走的怎么翻回去看?
Ctrl + A,然后按一下 ESC,然后方向键
评论前必须登录!
注册