$PSVersionTable:Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:
code -v
1.21.1
79b44aa704ce542d8ca4a3cc44cfca566e7720f1
x64
$pseditor.EditorServicesVersion
code --list-extensions --show-versions
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.16299.251
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.251
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Run a command in PowerShell that sends a bunch of output to the terminal window. Scroll up through the terminal window so that you can't see the bottom. Run a command in the editor window, and the terminal window doesn't move. Would love to have a setting (if not the default) that jumps to the bottom of the terminal window when it's not visible. I outlined how to do this (and referenced a StackOverflow question) about how to do this in Code with the Macros extension. https://jacobbenson.io/index.php/2018/03/27/jump-to-terminal-in-visual-studio-code-when-running-powershell/
Follow the instructions in the README
about capturing and sending logs.
Sounds like a reasonable request. Thanks for opening this! Question for you, does this work in the default Powershell/cmd/bash terminal in vscode or does it not scroll down only in the PowerShell Integrated Console?
How can I test this? Whenever I run anything that's PowerShell it jumps to the PowerShell Integrated Console.
Ah. Reading the issue again I see what you mean - ignore my question :)
I missed this part:
Run a command in the editor window
This is not limited to PowerShell, the topic of this issue should be changed.
And the issue should be moved to VSCode itself and not the powershell plugin.
I am currently using VSCode with the Rust plugin on Linux and when I start a build it outputs the build log on the integrated terminal and once I have scrolled up to read the errors it will no longer autoscroll when I start a new build. This is extremely annoying.
Workaround for PowerShell:
Install the macros extension, then define macros and keybindings as outlined here.
@Tyriar pinging you because of @prof7bit's added comment that this also happens in the Rust extension.
Do you folks have a way for us to add this? Or should we open an issue on vscode?
If it makes sense for an extension to scroll to the bottom then it can call workbench.action.terminal.scrollToBottom when it's running the new command. In the general case VS Code will only do this automatically on keyboard input and it doesn't make sense to add a setting to do otherwise, this would be super annoying if you wanted to look at output while running a command.
We probably want to invoke this when sending certain requests then. I think the big one is F8 (Run Selection). Which would probably be as simple as adding:
let success = await commands.executeCommand('workbench.action.terminal.scrollToBottom');
This works well:
vscode.commands.registerCommand("PowerShell.RunSelection", async () => {
...
// Show the integrated console if it isn't already visible and scroll console to see output
await vscode.commands.executeCommand("PowerShell.ShowSessionConsole", true);
await vscode.commands.executeCommand("workbench.action.terminal.scrollToBottom");
Want me to PR that? Also, should we put this behavior behind a setting? I would default it to scroll to bottom. Even though that is a change in behavior, it is the behavior most folks expect IMO.
Looks good :slightly_smiling_face:
Most helpful comment
This is not limited to PowerShell, the topic of this issue should be changed.
And the issue should be moved to VSCode itself and not the powershell plugin.
I am currently using VSCode with the Rust plugin on Linux and when I start a build it outputs the build log on the integrated terminal and once I have scrolled up to read the errors it will no longer autoscroll when I start a new build. This is extremely annoying.