4

I'm currently using WSL for some shared development and one thing is bothering me: how to scroll terminal up/down in classical UNIX termianl fashion (i.e. using Shift + PgUp or Shift + PgDn)? It does not work with any of common combinations:

  • Shift + PgUp
  • Ctrl + Shift + Up

With or without Shortcuts with Ctrl enabled option.

Any help is appreciated.

  • If you left click on the window and press Shift + PgUp it should work. This will make your cursor select everything in its path and it will look super ugly, but atleast it works. I would stick to using the scroll wheel for now. – Bungicasse Feb 23 at 20:45
  • In PowerShell PageUp and PageDown scrolls up and down the console. Unfortunately running bash inside powershell still doesn't solve the problem – phuclv Feb 24 at 12:38
2

Let have some little introduction. In Windows, Command Prompt is a shell, not a terminal. And wsl.exe is a command line program. There are many terminal emulators with Unix-like terminal features for Windows.

For shared environment, using ssh with WSL (Windows Subsystem for Linux) is better option. Run sshd daemon in WSL with sudo service ssh start command (Here I skip the certificate exchange step). There are many articles and Q&A you can follow. Now the main part i.e. keyboard shortcuts. In Windows side, run ssh user_name@localhost with any terminal emulator like putty, mintty, kitty, MobaXterm, ConEmu etc., all have that page up/down keyboard shortcuts built-in.

If you want to skip the hassle of ssh setup then you can use wsltty, which uses mintty (terminal emulator) and wslbridge (same as ssh but pre-configured). mintty has the keyboard shortcuts like previous examples.

  • This is full and reach in technical knowledge answer to my issue. Thank you! – Tomas Feb 25 at 8:07
3

Mouse scroll works fine, but not the keyboard.

I suggest using AutoHotkey with the following script to enable Shift+PgUp and Shift + PgDn:

#IfWinActive ahk_class ConsoleWindowClass

+PgUp::
Send {WheelUp}
Return

+PgDn::
Send {WheelDown}
Return

#IfWinActive
  • This works well, though I prefered to use multiple instances of {WheelUp} and {WheelDown} to scroll more than the few lines it does by default. e.g. Send {WheelUp}{WheelUp}{WheelUp}{WheelUp} – spiralofhope Jun 2 at 0:19
  • Nice workaround. Thanks. – Terje Mikal Sep 24 at 10:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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