Walt Mankowski on Wed, 05 Feb 2003 21:01:08 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] screen (was: "Friends don't let friends use Dell")


On Wed, Feb 05, 2003 at 08:15:34PM -0500, Michael C. Toren wrote:
> Recent versions of screen(1) do indeed have support for vertically
> split regions, similar to ircii's /window support.  Using the default
> keybindings[1] in version 3.9.9, "C-a S" will split a screen into two
> regions, "C-a X" will remove a region, and "C-a tab" will change the
> input focus to the next region.  Unfortunately, regions do not keep
> state after detaching.
> 
> -mct
> 
> [1] I hate the defaults, and instead use the following in my ~/.screenrc:
> 
> 	bind = resize =
> 	bind + resize +1
> 	bind - resize -1
> 	bind _ resize 
> 	bind j focus down
> 	bind J focus down
> 	bind k focus up
> 	bind K kill

Just to follow up a bit here, when you split a screen with C-a S, it
divides the current window in half and creates a blank window below
it.  Initially both windows are the same size.  If you want to resize
the current window, you need to use the "resize" command.

resize doesn't have a default keybinding, which is why Mike adds some
in his example above.  If you want to resize a window with the default
keybindings, you need to use "C-a : resize".  C-a : by default is
bound to the "colon" command which allows you to enter any screen
command.  (They're listed in the man page under CUSTOMIZATION.)

Also, as you can see from Mike's keybindings, resize can resize the
window in a number of different ways.  "resize =" makes all the
windows the same size.  "resize +1" makes the window one line larger,
and "resize -1" makes it one line smaller.  In contrast, "resize 1"
(without a plus or minus) would make the window *exactly* one line
high.  There are more options than this; see screen's man page for
complete details.

As another example, I often like to set up my screen session so that
there's a small window on the bottom that's tailing my .procmailrc
log, while in the bigger window above I switch between mutt, irc,
etc.  Here's how I do it:

C-a S         # split the window in half
C-a tab       # switch to the bottom window
C-a 2         # switch to window 2, where I'm running tail -f mail_log
C-: resize 10 # resize window to 10 lines, which is enough to show 3
              # entries (each email generates 3 lines in the log)
C-a tab       # switch back to the top window
C-a 0         # mutt window
C-a 2         # irc window

Yeah, I know it seems like a lot, and I should really automate it.
But I don't do it all that often, and once you're familiar with the
keybindings it only takes a few seconds.

Walt

Attachment: pgpJRZGiHDWW5.pgp
Description: PGP signature