Fix focus stealing when clearing terminal scrollback#2334
Conversation
There was a problem hiding this comment.
Pull request overview
Maps the terminal scrollback setting into PSES and clears saved lines in-band, avoiding the focus-stealing client command.
Changes:
- Adds integrated-console settings handling.
- Emits xterm’s
CSI 3 Jsequence when configured. - Adds regression tests for configuration updates and terminal output.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
LanguageServerSettings.cs |
Maps the scrollback setting into PSES configuration. |
EditorOperationsService.cs |
Clears scrollback directly without a client notification. |
EditorOperationsServiceTests.cs |
Tests settings propagation and emitted output. |
@microsoft-github-policy-service agree |
Summary
powershell.integratedConsole.forceClearScrollbackBufferinto the language-server settings.CSI 3 Jsequence directly from PSES when the setting is enabled, so clearing saved lines no longer invokes the focus-stealing client command.Validation
Invoke-Build -Configuration Release TestFull(351 unit tests passed with 1 platform skip; 48 stable-PowerShell E2E tests passed with 2 platform skips; 48 preview-PowerShell E2E tests passed with 2 platform skips)EditorOperationsServiceTests(4 passed)dotnet format PowerShellEditorServices.sln --no-restore --verify-no-changes --include src/PowerShellEditorServices/Services/Workspace/LanguageServerSettings.cs src/PowerShellEditorServices/Services/Extension/EditorOperationsService.cs test/PowerShellEditorServices.Test/Extensions/EditorOperationsServiceTests.csgit diff --check upstream/main...HEADThe Windows PowerShell 5.1-only legs were not available on this Linux host and remain covered by upstream CI.
Fixes #2313