You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bash hook: nothing is captured with VS Code's shell integration loaded after it #52
With VS Code's bash shell integration loaded after the codigest hook (VS Code sources it after ~/.bashrc), no command is captured.
Cause: VS Code chains an existing DEBUG trap but runs it only for the first DEBUG event of each command line (__vsc_preexec_all, guarded by __vsc_in_command_execution). bash also runs the DEBUG trap for a bind -x handler, and the hook marks the line with one (__cdg_mark on Enter). That first event is the handler, before __cdg_mark has opened the capture, so __cdg_debug never sees the command itself and the capture never starts. VS Code's own preexec also fires at the handler instead of the command.
To reproduce: in an interactive bash --norc -i with cdg on PATH, source src/codigest/shell/hook.sh, then VS Code's script (code --locate-shell-integration-path bash), then run any command: it is not captured. tests/test_hook_terminal.py::test_bash_vscode_integration_sees_the_typed_line shows it.
Possible fixes: start the capture without relying on the next DEBUG event once a line is marked, or let the Enter handler leave other preexec frameworks' state as it found it. bash-preexec ignores bind -x handlers, so the same conflict may not appear there; not checked.
Activity
feat(hook): let programs that run commands keep the terminal (#53)