Chinaunix首页 | 论坛 | 博客
  • 博客访问: 270736
  • 博文数量: 48
  • 博客积分: 1062
  • 博客等级: 准尉
  • 技术积分: 531
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-23 09:47
文章分类
文章存档

2021年(1)

2019年(1)

2014年(4)

2011年(42)

分类: LINUX

2011-10-13 11:36:03

screen是gnu的一个项目,解决了单独使用终端的几个弊端, 常用功能如下:

1. 多“窗口”功能,不论你用的是gnome-terminal, konsole, xterm, rxvt...都可以方便的开启多个窗口,比gnome-termial自带的 "open terminal(tab)"好用的多。

2. Detach. 经常连其它机器的同学会比较有用,具体见 google

3. 窗口分割。

4. 命令行“远程协助”

详细信息的大家可以google一下,这里不再多说,直接放上我的配置文件,帖在 ~/.screenrc 里即可。

有任何使用方面的问题,可以直接联系我,免费提供支持 :)


startup_message off

#  定义screen的功能键为Ctrl-Z。向终端输入Ctrl-Z时应按 Ctrl-Z z。
escape ^Zz

#键绑定
bind , copy
bind . paste .

#term rxvt-unicode
#term xterm
term screen

# Dynamic title
shelltitle '$ |bash'

# 在最下一行显示窗口列表和时钟
hardstatus on
hardstatus alwayslastline
hardstatus string "%{gk}[ %{G}%H %{g}][%=%{.kW}%-w%{r}[%n %t]%{-}%+w%=%{g}]%{C}[ %m/%d %c:%s ]%{W}"

# hardstatus string "%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= kw}%?%+Lw%?%?%= %{g}]%{=b C}[ %m/%d %c:%s ]%{W}"
# hardstatus string "%{.kW}%-w%{.rY}%n %t%{-}%+w %=%{..G} %H(%l) %{..Y} %Y/%m/%d %c:%s "
# hardstatus alwayslastline " %-Lw%{= Bw}%n%f %t%{-}%+Lw %=| %0c:%s "

###   一般设置
vbell off
shell bash
# 屏幕缓冲区 1024 行。
#defscrollback 1024


把下面这段加入 .bashrc 里,可以让screen的窗口名称显示为当前正在运行的程序。


#screen and xterm's dynamic title
case $TERM in
    xterm*)
        # Set xterm's title
        TITLEBAR='\[\e]0;\u@\h:\w\a\]'
        PS1="${TITLEBAR}${PS1}"
        ;;
    screen*)
        # Use path as title
        PATHTITLE='\[\ek\W\e\\\]'
        # Use program name as title
        PROGRAMTITLE='\[\ek\e\\\]'
        PS1="${PROGRAMTITLE}${PATHTITLE}${PS1}"
        ;;
    *)
        ;;
esac

阅读(1997) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~