Next: , Previous: Bind, Up: Key Binding

14.2 Examples of the bind command

Some examples:

     bind ' ' windows
     bind ^f screen telnet foobar
     bind \033 screen -ln -t root -h 1000 9 su

would bind the space key to the command that displays a list of windows (so that the command usually invoked by C-a C-w would also be available as C-a space), bind C-f to the command “create a window with a TELNET connection to foobar”, and bind <ESC> to the command that creates an non-login window with title ‘root’ in slot #9, with a superuser shell and a scrollback buffer of 1000 lines.

     bind -c demo1 0 select 10
     bind -c demo1 1 select 11
     bind -c demo1 2 select 12
     bindkey "^B" command -c demo1

makes C-b 0 select window 10, C-b 1 window 11, etc.

     bind -c demo2 0 select 10
     bind -c demo2 1 select 11
     bind -c demo2 2 select 12
     bind - command -c demo2

makes C-a - 0 select window 10, C-a - 1 window 11, etc.