기본적으로 아래에 게시 한 내 것과 같습니다. 프로그램 '화면'에 추가 된 기능을 찾고 있습니다. 최소한 마지막 세션에서 화면 세션의 맨 아래에 환상적인 '메뉴 막대'가 있는지 확인하십시오.
## gyaresu's .screenrc 2008-03-25
# http://delicious.com/search?p=screenrc
# Don't display the copyright page
startup_message off
# tab-completion flash in heading bar
vbell off
# keep scrollback n lines
defscrollback 1000
# Doesn't fix scrollback problem on xterm because if you scroll back
# all you see is the other terminals history.
# termcapinfo xterm|xterms|xs|rxvt [email protected]:[email protected]
# These will let you use
bind -c selectHighs 0 select 10 #these three commands are
bind -c selectHighs 1 select 11 #added to the command-class
bind -c selectHighs 2 select 12 #selectHighs
bind -c selectHighs 3 select 13
bind -c selectHighs 4 select 14
bind -c selectHighs 5 select 15
bind - command -c selectHighs #bind the hyphen to
#command-class selectHighs
screen -t rtorrent 0 rtorrent
#screen -t tunes 1 ncmpc --Host=192.168.1.4 --port=6600 #was for connecting to MPD music server.
screen -t stuff 1
screen -t irssi 2 irssi
screen -t dancing 4
screen -t python 5 python
screen -t giantfriend 6 these_are_ssh_to_server_scripts.sh
screen -t computerrescue 7 these_are_ssh_to_server_scripts.sh
screen -t BMon 8 bmon -p eth0
screen -t htop 9 htop
screen -t hellanzb 10 hellanzb
screen -t watching 3
#screen -t interactive.fiction 8
#screen -t hellahella 8 paster serve --daemon /home/gyaresu/downloads/hellahella/hella.ini
shelltitle "$ |bash"
# THIS IS THE PRETTY BIT
#change the hardstatus settings to give an window list at the bottom of the
##screen, with the time and date and with the current window highlighted
hardstatus alwayslastline
#hardstatus string '%{= mK}%-Lw%{= KW}%50>%n%f* %t%{= mK}%+Lw%< %{= kG}%-=%D %d %M %Y %c:%s%{-}'
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
니스 화면을 설정하는 덜 비밀스러운 방법을 원한다면 byob (이전의 화면 프로필이라고 함)를 강력히 추천 할 수 있습니다. 화면 맨 아래에 멋진 기본 항목 세트가 있습니다. 맨 아래 줄에는 다양한 편리한 상태 정보가 있고 맨 아래 줄에는 화면 창의 목록이 있습니다. F9를 누르면 Nice easy ncurses 메뉴에서이 모든 것을 구성 할 수 있습니다.
기능 키는 일반적인 작업에 매핑됩니다.
자습서 및 스크린 샷은이 기사 을 참조하십시오.
Byobu는 karmic (9.10)부터 우분투 저장소에 있습니다. jaunty에서는 스크린 프로파일이라고 불렀습니다. 그 전에 this ppa from - download page 에서 설치할 수 있습니다. 다른 최신 배포판에도 널리 사용됩니다.
그것은 파이썬에 달려 있지만, 원하는대로 byobu를 설정하면 byobu-export 를 사용하여 다른 컴퓨터에서 화면을 다시 만드는 데 필요한 모든 것을 포함하는 타르 볼을 생성하도록 할 수 있습니다.
또한 드롭 다운 탭의 효과를 시뮬레이션하기 위해 상당히 관련된 캡션/하드 상태 라인 조합을 사용합니다 (자막 라인은 회색으로 표시되고 하드 상태의 현재 탭은 동일한 색상).
또한 쉘에 현재 프로세스 이름과 디렉토리를 알려주므로 탭 이름은 각 탭에서 수행중인 작업과 최신 상태로 유지됩니다. 이것은 열려있는 모든 탭을 넘기지 않고 내가하고있는 일을 기억하는 데 중요합니다.
# don't use the hardstatus line for system messages, use reverse video instead
# (we'll be using it for the list of tab windows - see hardstatus alwayslastline
# below)
hardstatus off
# use the caption line for the computer name, load, hstatus (as set by zsh), & time
# the caption line gets repeated for each window being displayed (using :split),
# so we'll use color cues to differentiate the caption of the current, active
# window, and the others.
# always - display the caption continuously. Since
# hardstatus is 'alwayslastline', it will be on the
# next to last line.
# "%?%F" - if (leading '%?') this region has focus ('%F')
# (e.g. it's the only region being displayed, or,
# if in split-screen mode, it's the currently active
# region)
# "%{= Kk}" - set the colorscheme to blac[k] on grey (bright blac[K]),
# with no other effects (standout, underline, etc.)
# "%:" - otherwise ('%:' between a pair of '%?'s)
# "%{=u kR}" - set the colorscheme to [R]ed on blac[k], and
# underline it, but no other effects (bold, standout, etc.)
# "%?" - end if (trailing '%?')
# " %h " - print two spaces, tthne the [h]ardstatus of the
# current tab window (as set by zsh - see zshrc) and
# then another space.
# "%-024=" - either pad (with spaces) or truncate the previous
# text so that the rest of the caption string starts
# 24 characters ('024') from the right ('-') Edge of
# the caption line.
# NOTE: omitting the '0' before the '24' would pad
# or truncate the text so it would be 24% from the
# right.
# "%{+b} - add ('+') [b]old to the current text effects, but
# don't change the current colors.
# " %C:%s%a %D %d %M %Y" - print the [C]urrent time, a colon, the [s]econds,
# whether it's [a]m or pm, the [D]ay name, the [d]ay
# of the month, the [M]onth, and the [Y]ear.
# (this takes up 24 characters, so the previous
# pad/truncate command makes sure the clock doesn't
# get pushed off of the caption line)
# "%{= dd}" - revert to the [d]efault background and [d]efault
# foreground colors, respectively, with no ('= ')
# other effects.
# other things that might be useful later are
# " %H" - print a space, then the [H]ostname.
# "(%{.K}%l%{-}):" - print a '(', then change the text color to grey
# (aka bright blac[K]), and print the current system
# [l]oad. Then revert to the previous colorscheme
# ('%{-}') and print a close ')' and a colon.
# NOTE: the load is only updated when some other
# portion of the caption string needs to be changed
# (like the seconds in the clock, or if there were a
# backtick command)
# "%0`" - put the output of a backtick command in the line
# "%-024<" - don't pad, just truncate if the string is past 24
# characters from the right Edge
# "%-=" - pad (with spaces) the previous text text so that
# the rest of the caption string is justified
# against the right Edge of the screen.
# NOTE: doesn't appear to truncate previous text.
caption always "%?%F%{= Kk}%:%{=u kR}%? %h %-024=%{+b} %C%a %D %d %M %Y%{= db}"
# use the hardstatus line for the window list
# alwayslastline - always display the hardstatus as the last line of the
# terminal
# "%{= kR} %-Lw" - change to a blac[k] background with bright [R]ed text,
# and print all the tab [w]indow numbers and titles in
# the [L]ong format (ie with flags) upto ('-') the
# current tab window
# "%{=b Kk} %n%f %t " - change to grey (bright blac[K]) background with
# [b]old blac[k] text, with no other effects, and print
# the [n]umber of the current tab window, any [f]lags it
# might have, and the [t]itle of the current tab window
# (as set by zsh - see zshrc).
# NOTE: the color match with the caption line makes it
# appear as if a 'tab' is dropping down from the caption
# line, highlighting the number & title of the current
# tab window. Nifty, ain't it)
# "%{-}%+Lw " - revert to the previous color scheme (red on black)
# and print all the tab [w]indow numbers and titles in
# the [L]ong format (ie with flags) after ('+') the
# current tab window.
# "%=%{= dd}" - pad all the way to the right (since there is no text
# that follows this) and revert to the [d]efault
# background and [d]efault foreground colors, with no
# ('= ') other effects.
hardstatus alwayslastline "%{= kR} %-Lw%{=b Kk} %n%f %t %{-}%+Lw %=%{= dd}"
여기 각 탭에서 수행중인 작업에 대한 화면을 알려주는 zshrc 설정이 있습니다.
# ~/.zshrc
# if using GNU screen, let the zsh tell screen what the title and hardstatus
# of the tab window should be.
if [[ $TERM == "screen" ]]; then
_GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^~$USER/~/"'
# use the current user as the prefix of the current tab title (since that's
# fairly important, and I change it fairly often)
TAB_TITLE_PREFIX='"`'$_GET_PATH' | sed "s:..*/::"`$Prompt_CHAR"'
# when at the Shell Prompt, show a truncated version of the current path (with
# standard ~ replacement) as the rest of the title.
TAB_TITLE_Prompt='$Shell:t'
# when running a command, show the title of the command as the rest of the
# title (truncate to drop the path to the command)
TAB_TITLE_EXEC='$cmd[1]:t'
# use the current path (with standard ~ replacement) in square brackets as the
# prefix of the tab window hardstatus.
TAB_HARDSTATUS_PREFIX='"[`'$_GET_PATH'`] "'
# when at the Shell Prompt, use the Shell name (truncated to remove the path to
# the Shell) as the rest of the title
TAB_HARDSTATUS_Prompt='$Shell:t'
# when running a command, show the command name and arguments as the rest of
# the title
TAB_HARDSTATUS_EXEC='$cmd'
# tell GNU screen what the tab window title ($1) and the hardstatus($2) should be
function screen_set()
{
# set the tab window title (%t) for screen
print -nR $'\033k'$1$'\033'\\\
# set hardstatus of tab window (%h) for screen
print -nR $'\033]0;'$2$'\a'
}
# called by zsh before executing a command
function preexec()
{
local -a cmd; cmd=(${(z)1}) # the command string
eval "tab_title=$TAB_TITLE_PREFIX$TAB_TITLE_EXEC"
eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX$TAB_HARDSTATUS_EXEC"
screen_set $tab_title $tab_hardstatus
}
# called by zsh before showing the Prompt
function precmd()
{
eval "tab_title=$TAB_TITLE_PREFIX$TAB_TITLE_Prompt"
eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX$TAB_HARDSTATUS_Prompt"
screen_set $tab_title $tab_hardstatus
}
fi
가장 유용한 화면 사용자 정의 IMHO는 수정 자 키를 C-a 이외의 다른 것으로 변경하는 것입니다. 그것은 키를 먹기에는 너무 중요합니다 (모든 readline 프롬프트에서 emacs에서 줄의 시작 부분으로 이동하십시오). 줄의 시작 부분에서 무언가를 편집 해야하는 것보다 응용 프로그램을 훨씬 더 자주 일시 중단해야하기 때문에 C-z를 사용합니다.
마법의 말씀은 :
escape ^za
나는 종종 10 개 이상의 창을 실행하고 있으며 선택할 수있는 방법을 원했습니다. Windows 10 ~ 19를 선택하도록 C-a Shift + 0 ~ 9를 구성하는 방법을 찾았습니다.
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
# 및 ^의 이스케이프에 유의하십시오.
vim과 같은 전체 화면 프로그램이 종료 된 후 스크롤 백 버퍼에 남아 있습니까? 실행하지 않을 때처럼 완전히 사라지면 좋지 않을 것입니다. 화면? ~/.screenrc 파일에 넣으십시오 ...
altscreen on
Ctrl + Alt + Left 및 Ctrl + Alt + Right를 사용하여 화면 창 사이를 전환하고 있습니다. 내 IRSSI 채널에는 Alt + Left 및 Alt + Right를 사용하고 그놈 작업 공간 전환에는 Ctrl + Alt + Shift + Left/Right를 사용합니다. 복잡해 보이지만 실제로는 실제로 잘 작동합니다.
그놈 터미널의 문자 코드는 PuTTY를 통해 연결할 때 문자 코드와 다르므로 항목을 복제해야했습니다. cat>/dev/null을 사용하여 적절한 문자 코드를 찾을 수 있습니다.
# KEYBOARD SHORTCUTS #
# execute 'cat > /dev/null' to see the character codes
# Change Escape Combination to Ctrl+f (Ctrl+a is too useful to lose)
escape ^Ff
# 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
Backtick 명령은 꽤 멋집니다. 맨 스크린에서 그것에 대해 읽으십시오. 나는 그렇게 사용합니다 :
backtick 1 15 15 $HOME/bin/cpuusage
# now add '%1`%% CPU' to your hardstatus string. Result is like 38.4% CPU.
Linux 및 Mac 용 cpuusage 스크립트는 다음과 같습니다.
#!/bin/bash
if [[ $(uname) == "Darwin" ]]; then
top -i1 -l2 -n0|awk '/CPU/{i+=1; gsub(/%/,"",$0);p=substr(sprintf("%3.2f",$8+$10),0,4);if(i==2){printf "%g", p}}'
else
awk 'NR==1 {p=substr(sprintf("%3.2f", ($2+$3)/($2+$3+$4+$5)*100),0,4); printf "%g", p;}'</proc/stat
fi
Urxvt를 사용하는 경우 다음이 허용됩니다. CTRL+LEFT 과 CTRL+RIGHT 이전 및 다음 탭 창으로 이동하는 데 사용됩니다.
bindkey "^[Od" prev # ctrl-left
bindkey "^[Oc" next # ctrl-right
항상 실행 중이거나 즉시 작성해야하는 원격 화면 세션에 다시 연결
bind V screen -t MYTABNAME ssh -t MYUSERNAME "screen -x main || screen -R -S main"
흐름 제어를 기본적으로 해제하면 CTRL+R 제대로 급류 :
defflow off
자체 사용자 계정으로 데몬으로 Torrent 를 실행하는 경우이 .screenrc가 유용 할 수 있습니다.
vbell off
startup_message off
escape ^Rr
screen -t rtorrent rtorrent
multiuser on
acladd YOURUSERNAME
defflow off
Gnu 화면에서 내 bash .profile을 강제로로드하는 방법 에 대한 답변을 기반으로 다음을 추가합니다.
Shell -$Shell
screen
에서 로그인 쉘을 시작하도록 ~/.screenrc
screen
를 통해 셸을 사용할 때 ~/.bash_profile
를 실행하려는 경우 매우 유용합니다.
# disable C-a s, which freezes the screen; can be resolved with C-a q
bind s
메뉴 막대가 없으면 살 수 없습니다. 많은 사람들이 가지고있는 메뉴를 좋아하지 않는 것은 시간입니다. PuTTY의 스크롤이 뒤로 스크롤되는 것을 방지합니다 (화면 업데이트로 간주되기 때문에)
창을 순환하도록 F11과 F12를 설정했는데, 특히 창> 10보다 창 사이를 더 빠르게 이동할 수 있습니다.
# Bind F11 and F12 (NOT F1 and F2) to previous and next screen window
bindkey -k F1 prev
bindkey -k F2 next