Skip to content
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

Git bash terminals have a delay after command execution #212090

Closed
Profesor08 opened this issue May 6, 2024 · 45 comments · Fixed by #214606
Closed

Git bash terminals have a delay after command execution #212090

Profesor08 opened this issue May 6, 2024 · 45 comments · Fixed by #214606
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release important Issue identified as high-priority terminal-shell-git-bash An issue in the terminal specific to git bash on Windows, including shell integration terminal-shell-integration Shell integration infrastructure, command decorations, etc. verified Verification succeeded

Comments

@Profesor08
Copy link

Profesor08 commented May 6, 2024

Type: Bug

  1. Open terminal
  2. Start git bash
  3. Press Enter and you will get delay
Recording.2024-05-06.142202.mp4

VS Code version: Code - Insiders 1.90.0-insider (ccba2fc, 2024-05-06T08:07:13.626Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs AMD Ryzen 9 3900XT 12-Core Processor (24 x 3793)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.92GB (15.69GB free)
Process Argv --crash-reporter-id 15de8306-e8a1-4213-8c02-ebcaa1dda863
Screen Reader no
VM 0%
Extensions (42)
Extension Author (truncated) Version
rust-bundle 1Yi 1.0.0
glance ahk 0.0.8
project-manager ale 12.8.0
redmodscript-lang alt 0.2.0
redmodtweak-lang alt 0.1.0
lit-html bie 1.11.1
glsl-literal boy 1.0.6
vscode-markdownlint Dav 0.55.0
vscode-eslint dba 2.4.4
composer-php-vscode DEV 1.45.15272
intelli-php-vscode DEV 0.12.15062
phptools-vscode DEV 1.45.15272
profiler-php-vscode DEV 1.45.15272
rust-syntax dus 0.6.1
gitlens eam 14.9.1
EditorConfig Edi 0.16.4
prettier-vscode esb 10.4.0
auto-close-tag for 0.5.15
auto-rename-tag for 0.1.10
copilot Git 1.186.856
copilot-chat Git 0.16.2024050601
todo-tree Gru 0.0.226
path-autocomplete ion 1.25.0
redscript-syntax-highlighting jac 0.0.3
auto-comment-blocks kev 1.0.1
dotenv mik 1.0.1
debugpy ms- 2024.6.0
python ms- 2024.6.0
vscode-pylance ms- 2024.4.1
remote-wsl ms- 0.88.2
hexeditor ms- 1.10.0
vscode-extension-auto-import Nuc 1.4.3
indent-rainbow ode 8.3.1
vscode-yaml red 1.14.0
rust-analyzer rus 0.3.1950
crates ser 0.6.6
shader sle 1.1.5
vscode-styled-components sty 1.7.8
vscode-stylelint sty 1.4.0
vscode-mdx uni 1.8.4
highlight-matching-tag vin 0.11.0
vscode-import-cost wix 3.3.0

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256197
vsc_aa:30263845
vscod805cf:30301675
vsaa593cf:30376535
py29gd2263:31024238
c4g48928:30535728
2i9eh265:30646982
962ge761:30841072
pythongtdpath:30726887
welcomedialog:30812478
pythonidxpt:30768918
pythonnoceb:30776497
asynctok:30898717
dsvsc013:30777762
dsvsc014:30777825
dsvsc015:30821418
pythontestfixt:30866404
pythonregdiag2:30926734
pyreplss1:30879911
pythonmypyd1:30859725
pythoncet0:30859736
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30870582
dsvsc016:30879898
dsvsc017:30880771
dsvsc018:30880772
cppperfnew:30980852
ccp2r3:30958153
pythonait:30973460
showvideot:31016890
chatpanelt:31014475
945dj816:31013170
pythoncenvpt:31022790
a69g1124:31018687
dvdeprecationcf:31036533
pythonprt:31036556
dwnewjupytercf:31035177

@meganrogge
Copy link
Contributor

does this reproduce if you disable shell integration, terminal.integrated.shellIntegration.enabled?

@meganrogge meganrogge added terminal-shell-git-bash An issue in the terminal specific to git bash on Windows, including shell integration info-needed Issue requires more information from poster labels May 6, 2024
@Profesor08
Copy link
Author

If I uncheck Shell Integration, it works well after terminal restart.

@meganrogge meganrogge removed the info-needed Issue requires more information from poster label May 6, 2024
@cpendery
Copy link
Member

@meganrogge I have more details in #212286 with what's going wrong. The issue was introduced by this PR #211963 where __vsc_escape_value becomes extremely slow

@meganrogge meganrogge added the bug Issue identified by VS Code Team member as probable bug label May 13, 2024
@Tyriar Tyriar added this to the June 2024 milestone Jun 3, 2024
@Tyriar Tyriar added the terminal-shell-integration Shell integration infrastructure, command decorations, etc. label Jun 3, 2024
@benjaminsuch
Copy link

I had the same issue and setting terminal.integrated.shellIntegration.enabled to false does the trick.

@awmorgan
Copy link

awmorgan commented Jun 6, 2024

When I just hit the enter key on a bash prompt it takes about 4 seconds for the prompt to return. I ran process monitor and noticed many many (maybe over a hundred) instances of bash.exe being spawned to run the shellIntegration-bash.sh script.

@meganrogge meganrogge reopened this Jun 6, 2024
@vscodenpa vscodenpa added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 6, 2024
@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2024
@meganrogge meganrogge removed the *duplicate Issue identified as a duplicate of another issue(s) label Jun 6, 2024
@shivapoudel
Copy link

@meganrogge Any idea where this ticket is tracked? Every reference to the issue is closed marking duplicate.

@xGeekoo
Copy link

xGeekoo commented Jun 6, 2024

Closing an unfixed issue that everyone have ?
I don't get the point

@meganrogge meganrogge reopened this Jun 6, 2024
@microsoft microsoft deleted a comment from vscodenpa Jun 6, 2024
@meganrogge
Copy link
Contributor

@shivapoudel I closed this accidentally, have reopened.

@vqt123
Copy link

vqt123 commented Jun 6, 2024

worked for me

image

@salgado-unleashed
Copy link

Hey guys

I'm having the same issue.
Running a single git status is taking over 15 seconds to complete the command.

After disabling terminal.integrated.shellIntegration.enabled, bash looks way better

@Tyriar
Copy link
Member

Tyriar commented Jun 11, 2024

@shivapoudel no exact date, but probably later this week

@Tyriar Tyriar closed this as completed Jun 11, 2024
@meganrogge meganrogge added the verified Verification succeeded label Jun 11, 2024
@fisherbe
Copy link

@meganrogge ,

Turning off shell integration only sorta helped me out.

It does return a result slightly faster, but it does not return the prompt back for 4 seconds or so, but only with python poetry workspaces/folders opened.

This slowness goes away if I don't have a workspace/folder open, a non-poetry python one, a javascript one, etc.

There's now a '(packagename-pythonversion)' at the top of my prompt when I open a python poetry folder and that seems to be taking forever to generate after each command.

Definitely wasn't happening before my last update. This seems like a separate issue? Or is it related somehow? Happy to open a separate Issue if needed.

@Sammy-T
Copy link

Sammy-T commented Jun 11, 2024

@fisherbe I don't know if this is the same as your issue but I've found that, if I already opened a terminal in a workspace before changing the setting, I had to kill the terminal for that workspace and open a new one so it would be initiated with the updated setting.

@maixuanhan
Copy link

maixuanhan commented Jun 12, 2024

does this reproduce if you disable shell integration, terminal.integrated.shellIntegration.enabled?

Yes. With the feature disabled, issue does not happen ✔. But the feature will not work also 😥. I can live without that feature but I like it. It makes my IDE look smarter.
It's strange. I remember the feature was there earlier without any issue.

@awmorgan
Copy link

@Tyriar @meganrogge Was the fix included in 1.90.1? The shell integration is still too slow even after I updated to 1.90.1. It still takes over a second for all those bash commands to run every time press the enter key at the terminal. I have to keep it off to keep my Windows git bash terminal usable. It seems like it takes around a second and a half to get a new prompt with that setting on. Is this expected?

I just updated to this version:
Version: 1.90.1 (user setup)
Commit: 611f9bf
Date: 2024-06-11T21:01:24.262Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.19045

@Tyriar
Copy link
Member

Tyriar commented Jun 13, 2024

@awmorgan it should be fixed yes, can you run time __vsc_report_prompt and paste in the results?

@awmorgan
Copy link

$ for i in {1..10}; do time __vsc_report_prompt; done

real 0m0.236s
user 0m0.045s
sys 0m0.092s

real 0m0.194s
user 0m0.045s
sys 0m0.076s

real 0m0.210s
user 0m0.030s
sys 0m0.122s

real 0m0.217s
user 0m0.015s
sys 0m0.152s

real 0m0.216s
user 0m0.061s
sys 0m0.138s

real 0m0.245s
user 0m0.045s
sys 0m0.123s

real 0m0.202s
user 0m0.015s
sys 0m0.091s

real 0m0.212s
user 0m0.061s
sys 0m0.091s

real 0m0.230s
user 0m0.000s
sys 0m0.153s

real 0m0.212s
user 0m0.045s
sys 0m0.108s

@awmorgan
Copy link

It seems like it's taking a long time to parse the prompt. My git bash prompt is user@host MINGW64 /c/path/to/dir (master), where the my /c/path/to/dir is a 29 character path. But sometimes it's a lot longer. Does a longer path make it slower?

When I cd to a 135 character path, and try to time it it just prints 633;D;0:

$ time __vsc_report_prompt
633;D;0

$ __vsc_report_prompt
633;D;0

@Tyriar
Copy link
Member

Tyriar commented Jun 13, 2024

@awmorgan those numbers aren't too bad, but regardless I think we need to rethink how we're doing this prompt reporting feature. I'm going to stick it behind a setting in #215482 so it's just disabled completely by default.

@jherico
Copy link

jherico commented Jul 2, 2024

This is still unreasonably slow, IMO.

If I'm running a shell with the extensions the shortest possible interval between two commands seems to be over 700ms on my machine:
image

Running without the shell integration, it's closer to 250ms, and that may only be because that's how fast I can press the ⇧⏎⇧⏎ keys:
image

Despite the improvement over 1.90.0, I still feel like I have to disable the shell integration. It's 2024. Having to wait a perceptible amount of time just for the terminal prompt to re-appear feels like a huge regression to 1980s computing. Is my floppy drive trying to seek to a specific sector?

@Tyriar
Copy link
Member

Tyriar commented Jul 3, 2024

@jherico v1.91 which I think is being released today includes the changes I mentioned in #212090 (comment), disabling the prompt reporting stuff completely (for the stable build):

Recording 2024-07-03 at 08 56 11

@jtsom
Copy link

jtsom commented Jul 3, 2024

I'm running 1.91.0 (insiders) and I still see a significant delay between prompts (on windows, using git-bash terminal). Turning the shell integration off speeds it up quite a bit.

@Tyriar
Copy link
Member

Tyriar commented Jul 3, 2024

@jtsom it's only disabled in the stable build. Insiders keeps the slower code as it provided reliability improvements and the plan is to optimize it soon.

@Sammy-T
Copy link

Sammy-T commented Jul 3, 2024

While v1.91 does seem to improve the delay, there's still a noticeable delay for me so I'll be sticking with the option disabled.

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jul 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release important Issue identified as high-priority terminal-shell-git-bash An issue in the terminal specific to git bash on Windows, including shell integration terminal-shell-integration Shell integration infrastructure, command decorations, etc. verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.