terminal: Page up/Page down scrolling in WSL shell doesn't work

The page up/page down keys don’t scroll in the WSL console (installed Debian from Windows store), neither do any combinations with Ctrl, Shift, etc. and those keys. They do scroll in PowerShell, so maybe the shell intercepts them?

(In bash, PgUp does nothing and PgDn outputs a ~; in zsh, the PgUp/PgDn keys cycle through the recent commands)

Build: Microsoft Windows [Version 10.0.17134.228]

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 23
  • Comments: 25 (5 by maintainers)

Most upvoted comments

@jeff-zone Add the following to your Windows Terminal config under the “keybindings” section:

{ "command": "scrollUpPage", "keys": "shift+pageup" },
{ "command": "scrollDownPage", "keys": "shift+pagedown" },

Please consider upping the priority of this one a bit - I’m sure it’s a simple task for talented engineers as yourselves, and it’s such a dealbreaker that I’ll have to stick with Cygwin (or a VM) until it’s implemented.

It’s nice to have a native Debian terminal and all, but it’s too painful to use if I can’t effortlessly scroll the terminal output with keyboard shortcuts…

I hate bumping, however this is a must for many Linux users who for many different reasons need to use a Windows machine. Do make it real in the next release, please!

but why on earth is this not a default setting?

page up/down pretty essential for anyone who wants to use the command line. please fix!

I too find this a small thing that makes a big difference, and was led off on a goose chase through various third-party Windows terminal window apps to try to fix it. I also notice many places where people are asking about this (Stackoverflow, the WSL repo, etc.) so the votes you get here are likely an underestimate of how much this feature would be appreciated by users.

That definitely sounds like something that powershell implemented themselves.

It’s already on the backlog to add support for keyboard shortcuts for scrolling 😃

on a new installation where I did not have access to my settings.json I’ve had a hard time inserting the keybindings suggested in comment https://github.com/microsoft/terminal/issues/237#issuecomment-631615841

if anyone else seeks this via search engines, insert the following at the end, between the last ] and the last } (the defaults end with a "schemes" section)

    ,
    "keybindings":
    [
        { "command": "scrollUpPage", "keys": "shift+pageup" },
        { "command": "scrollDownPage", "keys": "shift+pagedown" }
    ]

so the last lines would now looks like this:

    ],
    "keybindings":
    [
        { "command": "scrollUpPage", "keys": "shift+pageup" },
        { "command": "scrollDownPage", "keys": "shift+pagedown" }
    ]
}

Where and how do I add the lines to configure the WSL shell? I tried creating a /etc/wsl.conf with it, I searched for the appropriate settings.json in the windows directory etc. with no success.

settings - lower left corner - open json file. but anyway Microsoft should make keys work like Linux terminals, not their own way. shift pgup should be default, not us having to edit json

Where and how do I add the lines to configure the WSL shell? I tried creating a /etc/wsl.conf with it, I searched for the appropriate settings.json in the windows directory etc. with no success.

@gmckeown I was unable to reproduce the “pageup” issue, so I’ve updated my comment above accordingly.

@DrChr Odd that “pageup” doesn’t work for you. The official Microsoft modifier key list has both forms, and both work fine for me:

https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#accepted-modifiers-and-keys

🤷‍♂️

I installed Windows Terminal in early December 2020. There were no scrollback settings in the default .json file; I had to copy them from this discussion.

@LordWolfenstein The new Windows Terminal has support for scrolling with the keyboard as well 😉 You can set keybindings for scrolling a single line at a time, a page at a time, and you can easily change which keys these actions are bound to. I’d recommend giving it a try!