[英]How to completely disable output scroll lock in Visual Studio Code?
As far as I could gather, even though VS Code's Output Panel has a Toggle Output Scroll Lock
icon in its title area据我所知,即使 VS Code 的输出面板在其标题区域中有一个
Toggle Output Scroll Lock
图标
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.我使用Code Runner并确保每次运行我的代码时手动向下滚动输出区域以查看任何让我发疯的东西。
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 ) 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
.测试了
VSCode
版本1.33.1
和CodeRunner
版本v0.9.9
。
It looks like the fix for this was released in March 2020 rather silently, as the hidden setting output.smartScroll.enabled
.看起来这个修复程序是在 2020 年 3 月悄悄发布的,因为隐藏设置
output.smartScroll.enabled
。
You'll need to make the following change in settings.json
:您需要在
settings.json
进行以下更改:
"output.smartScroll.enabled": false
Found this change mentioned here: https://github.com/microsoft/vscode/issues/69480#issuecomment-593401640发现这里提到的这个变化: https : //github.com/microsoft/vscode/issues/69480#issuecomment-593401640
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:
将以下设置放入 settings.json 文件中:
"code-runner.clearPreviousOutput": true,
This will clear the old output every time you run the code and display only the current output.这将在您每次运行代码时清除旧输出并仅显示当前输出。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.