Good .screenrc configuration for linux tool screen

本文详细介绍了如何自定义配置screen终端模拟器的screenrc文件,包括改变默认行为、优化滚动缓冲区、显示状态栏、快捷键绑定以及窗口管理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#
# ~/.screenrc
#
defshell /bin/bash
# not show welcome message
startup_message off
# define Ctrl-Z
escape ^Zz
# screen buffer
defscrollback 52400
## show status
hardstatus on
hardstatus alwayslastline
#hardstatus string "%{.bW}%-w%{.rY}%n %t%{-}%+w %=%{..G} %H(%l) %{..Y} %Y/%m/%d %c:%s "
hardstatus string "%{.bW}%-w%{.rY}%n %t%{-}%+w %=%{..G} %H(%l) %{..Y} %Y/%m/%d %C%a "
#close error prompt
vbell off
# Ctrl-Z w or Ctrl-Z Ctrl-W to show windows list
bind w windowlist -b
bind ^w windowlist -b


# clear the scrollback buffer when exiting full screen program like vim
altscreen on


# Shift+0 through 9 to select windows 10 through 19
bind  ! select 11
bind  @ select 12
bind \# select 13
bind  $ select 14
bind  % select 15
bind \^ select 16
bind  & select 17
bind  * select 18
bind  ( select 19
bind  ) select 10


# Open screen windows
chdir /opt/xxx/test/gz
screen -t test      1


chdir /opt/xxx/etc/gz
screen -t etc       2


chdir /opt/xxx/config/gz
screen -t config    3


chdir /opt/xxx/lib/gz
screen -t lib       0


# PREVIOUS WINDOW
# Ctrl + Alt + Left from gnome-terminal
bindkey ^[[1;7C prev


# Ctrl+Alt+Left from putty
bindkey ^[^[[D prev


# NEXT WINDOW
# Ctrl + Alt + Right from gnome-terminal
bindkey ^[[1;7D next


# Ctrl+Alt+Right from putty
bindkey ^[^[[C next



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值