screen使用

简介:

centos 7 要想title正常,需修改~/.bashrc

在~/.bashrc 中加入unset PROMPT_COMMAND

https://unix.stackexchange.com/questions/206100/gnu-screen-window-rename-nuisance

为此我还做了一个gif动画:

https://gitee.com/cshi/git-test/raw/master/screen-title-change-issue.gif

避免screen在vim,less等程序退出后不清屏

加上altscreen on选项

https://superuser.com/questions/137714/using-screen-commands-like-less-and-man-dont-clear-the-screen-afterwards/137751#137751

https://serverfault.com/questions/270103/gnu-screen-clearing-on-vim-less-etc-exit

设置别名

alias scr='screen'

如果提示要密码

https://superuser.com/questions/343965/what-is-the-default-password-of-screen

如果screen中的进程在消耗CPU,htop就会显示SCREEN进程占用CPU

[root@screen-4.5.0]$ cat ~/.screenrc

hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "

$HOME/.screenrc如果不生效,可能需要给screen 加-a参数

screen教程

http://www.ibm.com/developerworks/cn/aix/library/au-gnu_screen/
http://www.cnblogs.com/mchina/archive/2013/01/30/2880680.html
http://www.cnblogs.com/bamanzi/p/switch-tmux-to-gnu-screen.html
https://www.gnu.org/software/screen/manual/screen.html
http://web.mit.edu/gnu/doc/html/screen_15.html

源码

https://savannah.gnu.org/git/?group=screen

git地址

http://git.savannah.gnu.org/cgit/screen.git

用make install时,好像etc目录要手动复制??

root@screen-4.5.0$ make install
./etc/mkinstalldirs /opt/screen-4.05/bin /opt/screen-4.05/share/screen/utf8encodings
mkdir /opt/screen-4.05
mkdir /opt/screen-4.05/bin
mkdir /opt/screen-4.05/share
mkdir /opt/screen-4.05/share/screen
mkdir /opt/screen-4.05/share/screen/utf8encodings
cd doc ; make installdirs
make[1]: Entering directory `/root/tmp/screen-4.5.0/doc'
./../etc/mkinstalldirs /opt/screen-4.05/share/man/man1 /opt/screen-4.05/share/info
mkdir /opt/screen-4.05/share/man
mkdir /opt/screen-4.05/share/man/man1
mkdir /opt/screen-4.05/share/info
make[1]: Leaving directory `/root/tmp/screen-4.5.0/doc'
if [ -f /opt/screen-4.05/bin/screen-4.5.0 ] && [ ! -f /opt/screen-4.05/bin/screen-4.5.0.old ]; \
        then mv /opt/screen-4.05/bin/screen-4.5.0 /opt/screen-4.05/bin/screen-4.5.0.old; fi
/usr/bin/install -c screen /opt/screen-4.05/bin/screen-4.5.0
chown root /opt/screen-4.05/bin/screen-4.5.0 && chmod 4755 /opt/screen-4.05/bin/screen-4.5.0
if [ -f /opt/screen-4.05/bin/screen ] && [ ! -f /opt/screen-4.05/bin/screen.old ]; then mv /opt/screen-4.05/bin/screen /opt/screen-4.05/bin/screen.old; fi
rm -f /opt/screen-4.05/bin/screen
(cd /opt/screen-4.05/bin && ln -f -s screen-4.5.0 screen)
cp ./utf8encodings/?? /opt/screen-4.05/share/screen/utf8encodings
cd doc ; make install
make[1]: Entering directory `/root/tmp/screen-4.5.0/doc'
./../etc/mkinstalldirs /opt/screen-4.05/share/man/man1 /opt/screen-4.05/share/info
/usr/bin/install -c -m 644 ./screen.1 /opt/screen-4.05/share/man/man1/screen.1
make screen.info
make[2]: Entering directory `/root/tmp/screen-4.5.0/doc'
makeinfo ./screen.texinfo -o screen.info
make[2]: Leaving directory `/root/tmp/screen-4.5.0/doc'
if test -f screen.info; then d=.; else d=.; fi; \
    if test -f $d/screen.info; then \
    for f in $d/screen.info*; do /usr/bin/install -c -m 644 $f /opt/screen-4.05/share/info;done; \
    if /bin/sh -c 'install-info --version' >/dev/null 2>&1; then \
      install-info --info-dir=/opt/screen-4.05/share/info $d/screen.info; \
    else true; fi; \
    fi
make[1]: Leaving directory `/root/tmp/screen-4.5.0/doc'
if [ -d /usr/lib/terminfo ]; then \
        PATH="$PATH:/usr/5bin" tic ./terminfo/screeninfo.src; \
        chmod 644 /usr/lib/terminfo/s/screen*; \
    fi
termcap entry (./terminfo/screencap) should be installed manually.
You may also want to install ./etc/etcscreenrc in /opt/screen-4.05/etc/screenrc

注意源码编译时,make install之后的提示,要求要手工将screencap,etcscreenrc复制到相关目录。碰到问题时,不要忽略这一点

从此妈妈再也不担心我突然断线工作丢失了……

目录
相关文章
问题 There is no screen to be resumed matching
问题 There is no screen to be resumed matching
131 0
|
5月前
|
Python
Pygame基础5-Surface & Rect
Pygame基础5-Surface & Rect
|
算法 数据可视化 Docker
利用MAGeCK算法处理CRISPR Screen数据
上次文章结尾时候提到了MAGeCK RRA算法处理,这次我们就来学习一下,Model-based Analysis of Genome-wide CRISPR-Cas9 Knockout(MAGeCK) 是一个可以从全基因组CRISPR-CAS9筛查技术中识别重要基因计算工具。Mageck是由Wei Li 和 Shirley Liu lab共同开发维护的。
2273 0
|
编解码
怎么解决 ie 中获取 window.screen.width 不正确?
怎么解决 ie 中获取 window.screen.width 不正确?
153 0
怎么解决 ie 中获取 window.screen.width 不正确?
|
JavaScript 前端开发
一个dark mode的动画
一个dark mode的动画
130 0
一个dark mode的动画
|
前端开发 JavaScript
两个dark mode的动画
两个dark mode的动画
111 0
两个dark mode的动画
|
编解码
window.innerHeight window.outerHeight 与screen.height
本文目录 1. window 2. innerHeight与outerHeight 3. screen.height 4. 实例
420 0
window.innerHeight window.outerHeight 与screen.height
screen 配置与使用笔记
screen 多人使用的时候经常遇到 屏幕大小不一致导致无法正常显示,只需要 ctrl+a shift+; fill 即可解决. 可以通过下面#把ctrl +a 替换成ctrl+z(ctrl+a 经常会用此组合键实现光标移动) The resultsing command give you a s.
645 0
|
关系型数据库
|
监控 Linux