[Top][All Lists]

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

Re: Scrolling from within terminal emulators

From: Phil!Gregory
Subject: Re: Scrolling from within terminal emulators
Date: Tue, 19 Jul 2005 19:59:50 -0400
User-agent: Mutt/1.5.9i

* JCA <address@hidden> [2005-07-19 15:23 -0700]:
>   I have noticed that when starting rscreen as a process running on a
> terminal emulator (xterm, gnome-terminal) the scrolling capabilities
> of the terminal emulator seem to be disabled.

>   My query: Is it possible to map the scrolling capabilities built
> into screen on to the PageUp, Page Down keys?

I've taken a couple of stabs at this, without a great deal of success.
The problem is that scrollback in, say, xterm is nonmodal--at any time,
you can press Shift-PgUp and go backwards in the terminal's scroll
buffer.  screen, on the other hand, is modal--you must enter copy mode,
*then* go back a page, but once you're in copy mode, PgUp and PgDn work as
you'd expect.

The closest I've come has been:

In .screenrc:

  bindkey "^[[5;2~" eval "copy" "stuff ^b"

In .Xresources:

  XTerm.VT100.Translations: #override \n\
      Shift <Key>Prior:string(0x1b) string("[5;2")

This causes xterm to pass the Shift-PgUp through to whatever program is
running within (presumably screen)[0], and then screen will catch it,
enter copy mode, and go back a page.  The problem is that Shift-PgUp will
not work a second time, since it will always try to enter copy mode, and
screen doesn't like doing that (it displays an error message, which tends
to slow things down).

Next round I go with this will probably involve trying to have screen
rewrite xterm's keybindings when it enters and exits copy mode, which has
the problem of synchronization (not sure there's a way to execute a
command when screen exits copy mode as a result of an invalid keypress).

[0] Note that I've hardcoded the escape sequence instead of just binding
    it to insert().  That's because I had to hardcode the escape sequence
    in screen, since there's no termcap entity for Shift-PgUp (as far as I
    can tell).

-- contrarian of the first order... /
PGP: 026A27F2  print: D200 5BDB FC4B B24A 9248  9F7A 4322 2D22 026A 27F2
--- --
When the global thermonuclear war comes to deal with the market and
art-lovers everywhere, the only things left afterwards will be grass,
roaches and sooty IBM buckling spring keyboards.
                       -- Arvid Gidhagen
---- --- --

reply via email to

[Prev in Thread] Current Thread [Next in Thread]