-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Bash Shell Integration: Please co-exist with other trap DEBUG handlers (ie: leverage bash-preexec) #150241
Comments
I believe we have already fixed this: vscode/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh Lines 91 to 105 in 5357dcf
Adding @meganrogge to make sure |
Well, line 100 I think perhaps there needs to be 1 more state 'not in prompt' that causes preexec to bail until all prompt_command processing is done. Alternatively, if this is all to send __vsc_command_output_start - it seems like using PS0 on bash >= 4.4 would be a lot cleaner? |
Hi @meganrogge. This was on 1.67.2 with https://github.com/microsoft/vscode/blob/5357dcfc04ddfce12661dca80ae9a104640a2c7e/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh dropped in place. |
We've made some big changes in the past few days around debug trap and PS1 handling in bash, I believe the issues here are fixed. We may at some point hook into |
Actually I'll keep this open with help wanted to track integrating with bash-preexec. |
OK. Pulling the bash integration script on June-03 - Things look better, but not quite right. The problems I see (only when DEBUG trap is being used):
Here are my dotfiles: https://github.com/joerohde/dotfiles and a branch to help debug:
The repro environment/steps:
I appreciate the time and effort going into this feature. It's becoming a shockingly advanced embedded shell environment. |
@joerohde thanks again, planning on tackling this in June |
I use just merged in a fix for this. It would be great if someone could help verify in tomorrow's insiders build as I'm not normally a user of bash-preexec. |
Are there verif steps for this? |
This bug has been fixed in the latest release of VS Code Insiders! @joerohde, you can help us out by commenting If things still don't seem right, please ensure you're on version 9cf2fab of Insiders (today's or later - you can use Happy Coding! |
@rzhao271 what is your exact debug trap when that happens? |
The vscode shell integration currently needs to be turned off or disabled for anyone with complex prompt commands, or any trap DEBUG.
Please consider supporting some kind of chaining model so we can work with the shell integration as needed.
Even better - use the defacto package that has already been written.
VSCode is the 3rd script that wants to mess with prompts and traps - but it's the first to completely ignore
https://github.com/rcaloras/bash-preexec
Please consider shipping this along side
shellintegration-bash.sh
and sourcing/using it. If that is unacceptable, consider at leastdetecting this module has been loaded as documented in the repo - and using it:
fwiw: iterm2 has very very similar functionality to the vscode shell integration, but I've been able to work with it. Although they embedded the script directly, they kept the compatible function names and mechanisms and interop fine.
The text was updated successfully, but these errors were encountered: