As far as I could gather, even though VS Code's Output Panel has a Toggle Output Scroll Lock
icon in its title area
it still uses a feature called smart lock which means scrolling is enabled only if the output area is already scrolled all the way down to the bottom before the new output is generated (more on this here).
I use Code Runner and ensuring output area is manually scrolled down each time I run my code to see anything is driving me nuts.
It looks like the fix for this was released in March 2020 rather silently, as the hidden setting output.smartScroll.enabled
.
You'll need to make the following change in settings.json
:
"output.smartScroll.enabled": false
Found this change mentioned here: https://github.com/microsoft/vscode/issues/69480#issuecomment-593401640
I don't know if this behavior is intended or if it's a bug, but I think currently there is no real solution to entirely solve this problem.
Maybe the provided workarounds help you to better stay in control of how the output scrolling works.
Code Runner
: ctrl + alt + N)If you need to check some output which isn't in the current view, hover over the output window and make sure to just scroll using your mouse wheel without clicking inside the output window.
Tested with VSCode
version 1.33.1
and CodeRunner
version v0.9.9
.
Also, just found this setting - while not the exact fix, it could be a relief to many people. Put the following setting in your settings.json file:
"code-runner.clearPreviousOutput": true,
This will clear the old output every time you run the code and display only the current output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With