0

Inside a SSH session to a distant server, I use screen (similar tu tmux).

I know that, in order to scroll with PG-UP / PG-DOWN, one has to do this before:

CTRL+A[

This is not very handy.

Is there a way to configure screen to have something like SHIFT + PG-UP / SHIFT + PG-DOWN to scroll pages (or mouse scrolling), inside a SSH terminal? (without having to do CTRL+A, [)

Without screen, scrolling in a terminal is just as easy as doing SHIFT + PG-UP / SHIFT + PG-DOWN.

Note: With tmux, this might be the solution.

0
1

keys like SHIFT + PG-UP / SHIFT + PG-DOWN are captured by your terminal and never make it to screen, so that key is not directly available. It might be possible to rebind that to something that would make it to screen.

Also, screen is modal, in that CTRL+A [ (or alternately, CTRL+A ESC) puts it it into copy mode. Once in copy mode, the PG-UP / PG-DOWN keys work just fine for me. Since exiting copy mode resets the scroll, it would not make sense to create a binding to enter copy mode, scroll, and then exit copy mode. Since these single keys work already, I'm not sure how this could be improved unless you want to bind the 3 key sequence to enter copy mode to a key -- which likely would still have to be a two key sequence.

6
  • Thank you. The reason is: on FR keyboard, CTRL +A [ is particularly unhandy. Indeed, to do [, one has to press ALT GR + 5 ! That's why I want to avoid the entire thing of CTRL A, [
    – Basj
    Jul 28 '21 at 11:42
  • 1
    Do you have an ESC key? Use that instead of [
    – user10489
    Jul 28 '21 at 11:56
  • 1
    @Basj, the default bindings are unhandy on non-US keyboards, but you can reconfigure the keybindings. I have bind ' ' copy and bind . paste . in .screenrc (two separate lines), thus binding Ctrl-A space to start copy mode, and Ctrl-A <dot> to paste. Space is nice for entering copy mode since you can also mark the copy area and exit copy mode by tapping on space. (of course you can also change the command key from Ctrl-A to something else. The default being annoying in particular if you're used to using Ctrl-A in the Emacs sense of "go to start of line")
    – ilkkachu
    Jul 28 '21 at 12:01
  • @ilkkachu Oh this is great, please post your comment as an answer, it solves my problem of CTRL A [ unhandyness!
    – Basj
    Jul 28 '21 at 12:10
  • @user10489 CTRL+A ESC is good too!
    – Basj
    Jul 28 '21 at 12:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.