Skip to content

run_in_terminal tool missed the first char in sending a command into git bash terminal #275625

Open

Description

Testing #274904

Steps:

  1. Add a custom profile of Git Bash for chat.tools.terminal.terminalProfile.windows setting:
  "chat.tools.terminal.terminalProfile.windows": {
    "path": "C:\\Program Files\\Git\\bin\\bash.exe",
    "args": ["--login", "-i"]
  },
  1. Open chat and ask 'what's my ip?'

the chat log shows that run_in_terminal figured out the right command:
Image

however it missing the first letter when it sends the command into the terminal:

Image

Activity

  1. added
    chat-terminal
    on Nov 5, 2025
  2. added
    windows
    terminal-shell-git-bash
    bug
    terminal-shell-integration
    on Nov 5, 2025
  3. added this to the Backlog milestone on Nov 5, 2025
  4. u84six commented on Nov 17, 2025

    @u84six

    I think this is a dupe of a bug that has been around for a while. The devs said that they hoped it would be fixed in the latest 1.106, but I've confirmed that it's still an issue. I can't find the other defects that are related to this, hopefully they didn't get closed thinking that the defect is fixed. I'm running the latest version and I can confirm that I'm still seeing the issue when the terminal is linked to Git Bash

  5. 20 remaining items

  6. anthonykim1 commented on Mar 26, 2026

    @anthonykim1
    Contributor

    Thanks! Actually it should be in the 1.113.0.
    It will look like this with 1.25:
    Image

    Edit: I just tried #275625 (comment) and I was able to repro sometimes. I noticed I had to quickly type after ctrl+M. I dont hear the ding sound so this may be different from #224488

    I'll have to dig in and investigate.

    Edit2: I think ctrl+m and then typing is a different related to focus), I think the problem we want to tackle here is missing character when copilot sends commands(which doesnt deal with the focusing/keyboard related things). Could Bryan Chen (@bryanchen-d) Tony OHagan (@tohagan) Garret Wilson (@garretwilson) try again via sending commands to terminal via copilot with gitbash? with the conpty dll 1.25

    Image
  7. added
    terminal-input
    on Mar 26, 2026
  8. added
    *not-reproducible
    on Mar 26, 2026
  9. garretwilson commented on Mar 26, 2026

    @garretwilson

    Anthony Kim (@anthonykim1) , bad news.

    First, review my steps for reproducing this issue above. There are two parts, for two different ways to see the bug. They depend on the key mappings I mentioned (which are only conveniences to help with setting up the bug—the key mappings themselves aren't what trigger the bug, it's what the key mappings do that help to reproduce the bug).

    1. Type git .
    2. Type Ctrl+M to maximize the terminal.
    3. Immediately type s (as if you were going to type git status). The s is "eaten".

    Here's the follow-up, which shows the behavior we normally see when the line is blank.

    1. Type Backspace to delete the characters until the line is blank again.
    2. Type Ctrl+M to un-maximize the terminal (back to normal size).
    3. Immediately type x (or anything). The x is "eaten"; it does not appear.

    In v1.113 I tested both of those scenarios. It is easily reproducible, both with "Windows Use Conpty Dll" selected, and with it unselected (which you claim fixes the problem, because you closed this ticket).

    I restarted the VS Code instance, and I can still easily reproduce this. (I did not restart all the other VS Code instances I had open.)

    Please reopen this ticket. It is in fact reproducible, following the directions I gave. If you are unable to reproduce it, I will be happy to participate in a web call to show you.

    Version: 1.113.0 (user setup)
    Commit: cfbea10c5ffb233ea9177d34726e6056e89913dc
    Date: 2026-03-24T15:07:18+01:00
    Electron: 39.8.3
    ElectronBuildId: 13620978
    Chromium: 142.0.7444.265
    Node.js: 22.22.1
    V8: 14.2.231.22-electron.0
    OS: Windows_NT x64 10.0.26200
    
  10. garretwilson commented on Mar 26, 2026

    @garretwilson

    I think ctrl+m and then typing is a different related to focus), I think the problem we want to tackle here is missing character when copilot sends commands(which doesnt deal with the focusing/keyboard related things

    I cannot say for sure, but as a software developer with immense experience, sometimes I can make a guess based upon the type of behavior. In this case, I would bet on them being the same bug, because in earlier versions of GitHub Copilot, I would see exactly the same thing happen when the LLM would open a new terminal tab and attempt to type something. Opening the new terminal tab is exactly this sort of window resizing and focus issue as the reproducibility steps I outlined.

    In addition, I have instructions for the LLM to retry the command; when it follows the instructions and retries the command, it works, which is consistent with the reproducibility steps.

    Finally with the LLM this would normally happen with a new terminal, not an existing terminal which it had created earlier and which also had commands. Again this is exactly in line with the process for reproducing the issue for humans typing in the terminal

    And Anthony Kim (@anthonykim1) , even if you are correct that the human-typing bug is a separate issue (which I doubt), then that means the bug I filed #274234 should not have been closed as a duplicate! You can't have it both ways logically: you can't say, "oh, those are the same bug, so I'm closing the first one", but then say, "I'm closing the second one because it has been fixed, and it's a different bug than the one you first filed".

    Since you admit that the steps I gave is reproducible, either it's the same bug and this bug #275625 should be reopened, or it's a different bug and #274234 should be reopened! You can't have your Conpty and have it eat your character too! (That sentence should get points for cleverness, at least.) It makes no logical sense to say they are different bugs but that the first bug should be closed as a duplicate. Either it's the same bug or it's not.

  11. meganrogge commented on Mar 26, 2026

    @meganrogge
    Collaborator

    Garret Wilson (@garretwilson) is there a reason you use git bash instead of pwsh, which is what we recommend using for the best experience?

  12. garretwilson commented on Mar 26, 2026

    @garretwilson

    is there a reason you use git bash instead of pwsh, which is what we recommend using for the best experience?

    Hi, Megan Rogge (@meganrogge) . You asked this same question when #274816 was assigned to you. (I'll note that #274816 still isn't fixed, either.) This question is really off topic. To some extent why I want to use Bash is irrelevant to this bug. A cynical developer might even interpret the question as avoidance. But since you asked the question, I'll briefly respond:

    1. The first is consistency. I want to use a shell that all developers on the team can natively use across all platforms. Git Bash on Windows works for that purpose, and works really, really, well.
    2. The other big issue is that PowerShell is broken. There are bugs everywhere. Just one tiny example: even simple arguments with dots must be quoted. Tokenizer treats . as a separator when parsing a parameter token, which causes problem to argument parsing for native commands PowerShell/PowerShell#15541 was never fixed; the ticket was closed because nobody tended to it. That's just one example among many.

    I hope this ticket about a bug in VS Code doesn't get off track by some debate about PowerShell. I hope #274816 gets fixed as well.

    I am an enthusiastic VS Code user. I have been using and promoting VS Code since its early days. I am a paying customer. I will not be using PowerShell.

  13. u84six commented on Mar 26, 2026

    @u84six

    is there a reason you use git bash instead of pwsh, which is what we recommend using for the best experience?

    Hi, @meganrogge . You asked this same question when #274816 was assigned to you. (I'll note that #274816 still isn't fixed, either.) This question is really off topic. To some extent why I want to use Bash is irrelevant to this bug. A cynical developer might even interpret the question as avoidance. But since you asked the question, I'll briefly respond:

    1. The first is consistency. I want to use a shell that all developers on the team can natively use across all platforms. Git Bash on Windows works for that purpose, and works really, really, well.
    2. The other big issue is that PowerShell is broken. There are bugs everywhere. Just one tiny example: even simple arguments with dots must be quoted. Tokenizer treats . as a separator when parsing a parameter token, which causes problem to argument parsing for native commands PowerShell/PowerShell#15541 was never fixed; the ticket was closed because nobody tended to it. That's just one example among many.

    I hope this ticket about a bug in VS Code doesn't get off track by some debate about PowerShell. I hope #274816 gets fixed as well.

    I am an enthusiastic VS Code user. I have been using and promoting VS Code since its early days. I am a paying customer. I will not be using PowerShell.

    That was definitely a weird question. Who in hell would want to use Powershell to get around a file system? lol Anyhow, the bug that you've reproduced is the original bug that I submitted a while back (I think they marked it as a dupe). This bug is not fixed, and it most definitely has something to do with switching to the (git bash) terminal (maybe a focus-based race condition)

  14. removed
    *not-reproducible
    on Mar 26, 2026
  15. anthonykim1 commented on Mar 27, 2026

    @anthonykim1
    Contributor

    Still can't repro command being truncated when sent by copilot:
    https://github.com/user-attachments/assets/b749fd03-afd5-4d4b-9087-00cd2571588a

    GIF would be nice, as Bryan Chen (@bryanchen-d) can no longer repro copilot scenario either.
    Also please attach the tool call result via chat debug panel along with the "truncated" terminal command, or feel free to include this in the gif.
    Image

    I've spent hours on resizing issue, and it actually seems like its a gitbash issue. See the recording with live-time keypresses and how typing asd after each resize ends up in different visual output in gitbash itself. This is problem from gitbash.

    gitbashResizingProblem.mp4
  16. wolfsilver commented on Mar 27, 2026

    @wolfsilver

    For me, it's the exact opposite—it works fine in Git Bash.

    Image

  17. Zezombye commented on May 15, 2026

    @Zezombye

    Can confirm it seems related to typing after resizing (though I can't reproduce it consistently). Still happens with terminal.integrated.windowsUseConptyDll on. This also seems to be a duplicate of #215402.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugchat-terminalterminal-inputterminal-shell-git-bashterminal-shell-integrationwindows

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions