1

The console started by the Ubuntu WSL app doesn't have scrollbars, but the one started by wsl.exe (or bash.exe, cmd, Powershell) does have scrollbars, thought both appear otherwise identical:

Screenshot of wsl.exe and ubuntu.exe

You can see the scrollbars in wsl.exe (which lacks the Ubuntu logo) even though it's not in focus.

Why is this and what can I do about it?

6

This is an effect of the new console features:

console options screen with link to new console features

Console behavior

You can now resize the console window at will by grabbing an edge with the mouse and dragging it. Scroll bars only appear if you set window dimensions manually (by using the Layout tab in Properties) or if the longest line of text in the buffer is wider than the current window size.

You can get the scrollbars back:

  • permanently by making the height of the screen buffer size greater than the window height. I set it to 9999, which seems to be maximum and the closest you can get to the "unlimited" scrollback history available in some terminal emulators.
  • temporarily by resizing the window. If you make taller, the buffer height automatically increases to thew new window height, but it doesn't shrink when the window is made shorter. So you can make it much taller, then make it shorter to get scrollbars.

As to why ubuntu.exe behaved differently, I'm not sure. It seems wsl.exe and others use the default 9001 lines, but ubuntu.exe for some reason has the same dimensions for the scrollback buffer as the window. Might be a bug in default config.

1

You may want to create shortcut for "ubuntu.exe" and modify default values (see screenshot attached) to desired values. Then, use previously created and modified shortcut to launch WSL.

Then, "pin" that shortcut either to Windows Taskbar or Start menu (right mouse button click):

enter image description here

At the moment of writing this answer, creation of shortcut of "ubuntu.exe", properties of this shortcut are next:

Shortcut options and layout:

enter image description here

I suggest to look at underlined values on the screenshot:

  • Options - Command History - Buffer Size: looks like this setting related more to native "cmd.exe" programm setting, however I suggest to increase default value.
  • Layout - Screen Buffer Size - Height: this one enables/allows to scroll back (and forth) on specified number of lines (say - enable scrollbars).
  • Layout - Window Size - WidthHeight: self explaining window size, where "Screen Buffer Size - Width" from previous setting depends on "Window Size - Width" from this setting.

For example, here is folder path to "ubuntu.exe" in Windows 10 Enterprise version 1809, build 17763.504:

C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_1804.2018.817.0_x64__79rhkp1fndgsc

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.