-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Terminal improvements: command delay, PowerShell counter, and ZSH EOL mark #2456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Replace hardcoded 3000ms timeout with configurable Terminal.shellIntegrationTimeout in TerminalProcess.ts. This ensures consistent timeout behavior across all terminal integration features and allows users to control both timeouts through a single setting. The error messages are also updated to display the dynamic timeout value, providing clearer feedback when shell integration issues occur. Signed-off-by: Eric Wheeler <[email protected]>
When shell integration is unavailable, the UI would hang because the process was never properly released. This change fixes the issue by: - Emitting a 'completed' event with a descriptive message - Marking the terminal as not busy - Clearing the active stream - Allowing the process to continue Signed-off-by: Eric Wheeler <[email protected]>
Add a new configurable setting to control command execution delays in terminals. When set to a non-zero value, this adds a sleep delay after command execution via PROMPT_COMMAND in bash/zsh and start-sleep in PowerShell. The default value is 0, which disables the delay completely. This setting replaces the previous hardcoded delay of 50ms that was added as a workaround for VSCode bug #237208. Fixes: #2017 Signed-off-by: Eric Wheeler <[email protected]>
Add a new configuration option that allows users to toggle the PowerShell counter workaround. This workaround adds a counter to PowerShell commands to ensure proper command execution and output capture. The setting is disabled by default, allowing users to enable it only when needed. Signed-off-by: Eric Wheeler <[email protected]>
Added a new configuration option 'terminalZshClearEolMark' (default: true) that sets PROMPT_EOL_MARK='' in the terminal environment. This prevents issues with command output interpretation when the output ends with special characters like '%'. Added translations for all supported languages. Fixes: #2194 Signed-off-by: Eric Wheeler <[email protected]>
…egration Added two new terminal settings: - terminalZshOhMy: Sets ITERM_SHELL_INTEGRATION_INSTALLED=Yes for Oh My Zsh - terminalZshP10k: Sets POWERLEVEL9K_TERM_SHELL_INTEGRATION=true for Powerlevel10k Signed-off-by: Eric Wheeler <[email protected]>
|
|
This PR looks big, but its mostly config hooks and i18n int'l. Features themselves are small if-else hooks, except for ZDOTDIR which is being tested because its a bit bigger---but still ultimately just an if-else for when the feature is enabled, otherwise no change. |
Creates a temporary ZDOTDIR to handle zsh shell integration properly while preserving user's zsh configuration. This ensures VSCode shell integration works correctly with zsh without modifying the user's existing setup. - Add terminalZdotdir setting (disabled by default) - Create temporary directory with proper security (sticky bit) - Add automatic cleanup on terminal close - Add translations for all supported languages User confirmed fixes: Fixes: #2205 Fixes: #2129 Signed-off-by: Eric Wheeler <[email protected]>
Add new i18n strings for shell integration steps and expand troubleshooting text across all supported languages Signed-off-by: Eric Wheeler <[email protected]>
|
This is a confirmed fix for at least three users, probably more. Please push and release ASAP. |
| Terminal.setTerminalZshP10k(message.bool) | ||
| } | ||
| break | ||
| case "terminalZdotdir": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with other terminal Zsh-related cases, consider renaming 'terminalZdotdir' to 'terminalZshDotdir' (or another consistent variant) unless the current naming is intentional.
| }, | ||
| "commandDelay": { | ||
| "label": "Terminal command delay", | ||
| "description": "Delay in milliseconds to add after command execution. The default setting of 0 disables the delay completely. This can help ensure command output is fully captured in terminals with timing issues. In most terminals it is implemented by setting `PROMPT_COMMAND='sleep N'` and Powershell appends `start-sleep` to the end of each command. Originally was workaround for VSCode bug#237208 and may not be needed." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: The description for commandDelay uses 'Powershell' instead of the proper capitalization 'PowerShell'. Please update this for consistency.
| "description": "Delay in milliseconds to add after command execution. The default setting of 0 disables the delay completely. This can help ensure command output is fully captured in terminals with timing issues. In most terminals it is implemented by setting `PROMPT_COMMAND='sleep N'` and Powershell appends `start-sleep` to the end of each command. Originally was workaround for VSCode bug#237208 and may not be needed." | |
| "description": "Delay in milliseconds to add after command execution. The default setting of 0 disables the delay completely. This can help ensure command output is fully captured in terminals with timing issues. In most terminals it is implemented by setting `PROMPT_COMMAND='sleep N'` and PowerShell appends `start-sleep` to the end of each command. Originally was workaround for VSCode bug#237208 and may not be needed." |
mrubens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you!!
Context
This PR addresses several terminal-related issues:
Implementation
Terminal Command Delay Setting
PowerShell Counter Configuration
ZSH EOL Mark Clearing
UI Hang Prevention
Standardized Terminal Integration Timeouts
How to Test
Get in Touch
Discord: KJ7LNW
Fixes #2194
Fixes #2017
Important
This PR enhances terminal functionality by adding configurable command delays, PowerShell counter, and ZSH EOL mark clearing, while addressing UI hang issues and standardizing terminal integration timeouts.
terminal.commandDelaysetting to control command execution delays inTerminal.tsandTerminalProcess.ts.terminalPowershellCountersetting to toggle PowerShell counter workaround inTerminal.tsandTerminalProcess.ts.terminalZshClearEolMarksetting to clear ZSH EOL mark inTerminal.ts.TerminalProcess.ts.Terminal.shellIntegrationTimeoutinTerminalProcess.ts.SettingsView.tsxandTerminalSettings.tsxto include new terminal settings.This description was created by
for ae0ab56. It will automatically update as commits are pushed.