2012年3月31日 星期六

[Linux][screen] screen (full-screen window manager)


screen (full-screen window manager)



Command:




  1. screen -- open new screen of terminal


  2. screen -ls -- list all of screen of terminal


  3. screen -t happy -- set the screen of title


  4. screen -d -- detached screen of terminal


  5. screen -r xxx  -- attach screen of terminal


  6. ctrl+a :split        then windows split into two windows

    ctrl+a tab           shift to another windows

    ctrl+a 1              or other number -- switch to specific window


  7. Scroll the window

    ctrl+a+[      + j  (down)

                       + k (up)

                       + use mouse scrolling wheel

    3 method





ex:

There is a screen on:

    12724.pts-0.freeman-laptop    (04/01/2012 02:19:02 AM)    (Detached)



screen -r 12724 -- then back to this screen.

Edit script:

sudo vim /etc/screenrc

# Set hardstatus always on

hardstatus alwayslastline " %-Lw%{= Bw}%n%f %t%{-}%+Lw %=| %M %d %0c:%s "

第二個是在視窗底下新增一個很好用的狀態列(這很方便!一定要加這行!)

# bind Alt`~= to screen0~12

bindkey "^[`" select 0

bindkey "^[1" select 1

bindkey "^[2" select 2

bindkey "^[3" select 3

bindkey "^[4" select 4

bindkey "^[5" select 5

bindkey "^[6" select 6

bindkey "^[7" select 7

bindkey "^[8" select 8

bindkey "^[9" select 9

bindkey "^[0" select 10

bindkey "^[-" select 11

bindkey "^[=" select 12



Alt+` 切換至screen 0

Alt+1 切換至screen 1

Alt+2 切換至screen 2

...…(依此類推)

Alt+= 切換至screen 12

 



































































































































Key

Action

Notes

Ctrl+a c

new window

 

Ctrl+a n

next window

I bind F12 to this

Ctrl+a p

previous window

I bind F11 to this

Ctrl+a "

select window from list

I have window list in the status line

Ctrl+a Ctrl+a

previous window viewed

 

 

 

 

Ctrl+a S

split terminal horizontally into regions

Ctrl+a c to create new window there

Ctrl+a |

split terminal vertically into regions

Requires debian/ubuntu patched screen 4.0

Ctrl+a tab

After split terminal, use this command to switch.

 

Ctrl+a :resize

resize region

 

Ctrl+a :fit

fit screen size to new terminal size

Ctrl+a F is the same. Do after resizing xterm

Ctrl+a :remove

remove region

Ctrl+a X is the same

 

 

 

Ctrl+a d

detach screen from terminal

Start screen with -r option to reattach

Ctrl+a A

set window title

 

Ctrl+a x

lock session

Enter user password to unlock

Ctrl+a [

enter scrollback/copy mode

Enter to start and end copy region. Ctrl+a ] to leave this mode

Ctrl+a ]

paste buffer

Supports pasting between windows

Ctrl+a >

write paste buffer to file

useful for copying between screens

Ctrl+a <

read paste buffer from file

useful for pasting between screens

 

 

 

Ctrl+a ?

show key bindings/command names

Note unbound commands only in man page

Ctrl+a :

goto screen command prompt

up shows last command entered

Ctrl+a "

Choose which bash number you want

 









 

 






Reference:





0 意見:

張貼留言