* fix: command rewriting issues when terminal sandboxing is enabled
Fixes two issues with sandboxed terminal commands:
1. Sandboxed commands end up in shell history (#303769): The
PreventHistoryRewriter was running before SandboxRewriter, so the
leading space was applied to the inner command but not the final
sandbox-wrapped command. Moved PreventHistoryRewriter to run last.
2. cd CWD prefix not stripped in sandbox mode (#303848): The
SandboxedCommandLinePresenter was using the original (un-rewritten)
command for display, bypassing cd prefix stripping. Changed to use
forDisplay instead.
3. Fixed forDisplay being clobbered: The rewriter loop unconditionally
overwrote forDisplay, so later rewriters without a forDisplay
(like PreventHistoryRewriter) would clear the sandbox's display
value. Changed to only update when explicitly provided.
Fixes#303769Fixes#303848
* update doc comment for SandboxedCommandLinePresenter
* improve execute strategy logging for CI diagnostics
Upgrade strategy selection and completion logs to info level in
runInTerminalTool. In richExecuteStrategy, log at info level when
running in CI (for diagnosing shell integration race conditions)
and debug otherwise.
* fix: include ignorespace in bash shell integration history verification
When VSCODE_PREVENT_SHELL_HISTORY=1 is set (which it is for all tool
terminals created by the run_in_terminal tool), the bash shell
integration script sets HISTCONTROL="ignorespace" (line 67). This
causes bash to exclude space-prefixed commands from history.
Later in the same script (line 200), a regex decides whether to use
`history 1` or $BASH_COMMAND to capture the current command in
__vsc_preexec. The regex checks for erasedups, ignoreboth, and
ignoredups — but NOT ignorespace. This is a bug because:
1. The same script sets HISTCONTROL=ignorespace 130 lines earlier
2. ignoreboth (which IS in the regex) is defined by bash as
"ignorespace + ignoredups" — so the compound form was handled
but the simple form was not
The consequence: with HISTCONTROL=ignorespace and __vsc_history_verify=1,
__vsc_preexec calls `history 1` to get the current command. But the
command has a leading space (added by PreventHistoryRewriter), so bash
history never recorded it. `history 1` returns the PREVIOUS command
or nothing. This causes __vsc_current_command to be wrong or empty.
In __vsc_command_complete, when __vsc_current_command is empty, the
script sends the OSC sequence 633;D WITHOUT an exit code (line 373).
The VS Code side then receives onCommandFinished with exitCode=undefined,
breaking exit code detection for ALL tool terminal commands on bash.
The fix adds ignorespace to the existing regex, so bash falls back to
$BASH_COMMAND (which always works regardless of history settings).
This matches the behavior already provided when ignoreboth is set.
* docs: improve fix-ci-failures skill with faster log retrieval workflow
- setupRecreatingStartMarker returns IDisposable to stop marker recreation
before sending commands (prevents marker jumping on PSReadLine re-renders)
- noneExecuteStrategy waits for cursor to move past start line after sendText
before starting idle detection (prevents end marker at same line as start)
- findCommandEcho supports suffix matching for partial command echoes from
wrapped getOutput() results (shell integration ON with long commands)
- Suffix matching requires mid-word split to avoid false positives on output
that happens to be a suffix of the command (e.g. echo output)
- Integration tests: use ; separator on Windows, add && conversion test,
handle Windows exit code quirks with cmd /c
- Handle /usr/bin/bash (Linux) vs /bin/bash (macOS) in /tmp write test
- Handle 'Read-only file system' (Linux) vs 'Operation not permitted' (macOS)
- Add 'Read-only file system' to outputLooksSandboxBlocked heuristic
- Replace newlines with spaces (not empty) to handle terminal wrapping
- Extract outputLooksSandboxBlocked as exported function with unit tests
- Add bubblewrap and socat to Linux CI apt-get install
- Make sandbox test assertions platform-aware (macFileSystem vs linuxFileSystem)
- Make /etc/shells test accept both macOS and Linux first-line format
- Broaden wrapped prompt fragment regex to handle path chars (ts/testWorkspace$)
- Fix continuation pattern to match user@host:path wrapped lines
- Apply stripCommandEchoAndPrompt to getOutput() in BasicExecuteStrategy
(basic shell integration lacks reliable 133;C markers so getOutput()
can include command echo)
- Keep RichExecuteStrategy getOutput() unstripped (rich integration
has reliable markers)
Prevent sandbox-wrapped command lines from leaking as output when
commands produce no actual output. Adds stripCommandEchoAndPrompt()
to isolate real output from marker-based terminal buffer captures.
Also adds configurable idle poll interval and shell integration
timeout=0 support for faster test execution.
fix: update command center background and border styles in theme and adjust titlebar border radius
Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
* update theme names & make experimental themes new default
* feat: migrate legacy theme settings and update notification handling
* test: add unit tests for migrateThemeSettingsId function
* feat: add command to try new default themes and update notification message
* feat: refactor tryNewDefaultThemes command to use Action2 class
* feat: update theme names to remove 'Default' prefix and improve theme selection logic
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Regenerated all 126 baseline files (108 regular + 18 tree-sitter) by running the colorize integration tests.
---------
Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Reapply "Git - adopt the new package to use copy-on-write for the worktree include files (#299583)" (#300448)
This reverts commit c56c7bc071.
* Attempt to fix tests
* Fix build
* build: copy node_modules into extension bundle
* Regenerate lock file
---------
Co-authored-by: deepak1556 <hop2deep@gmail.com>