Skip to content

Using --delimiter / on Git Bash resolves to "C:/Program Files/Git" instead of "/", regardless of (single|double) quotes used #10769

Open

Description

@davidalayachew

Describe the bug

Consider the following command.

aws s3api list-objects-v2 --no-paginate --bucket SOME_BUCKET --prefix SOME_PREFIX --delimiter '/'

According to the AWS Documentation, you would expect this to return the Common Prefixes functionality.

If I run this command on Windows Command Prompt, I get a subsection in my JSON called "CommonPrefixes", exactly as expected.

But running the exact same command on Git Bash will have no "CommonPrefixes" section in my outputted JSON, and the delimiter will be listed as "Delimiter": "C:/Program Files/Git".

Now, maybe this is something that can be solved with better documentation. But, no matter how I tried -- with single quotes, double quotes, in a file, out of a file, etc., it would always create the delimiter as "C:/Program Files/Git/".

And for context, Git Bash is nothing more than a wrapper around Mintty -- a CLI tool that allows Windows users to get a minimal UNIX like shell running on Windows. And Git Bash comes as a part of the installation when you install Git on Windows. So, this is a problem for anyone using Git Bash (many people).

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

I expected to get a "CommonPrefixes" section in my outputted JSON, and for the delimiter to be the original "/" I provided it with.

Current Behavior

The "/" gets reinterpreted to mean the root of my shell, which is "C:/Program Files/Git/".

Reproduction Steps

  1. Create a bucket called SOME_BUCKET.
  2. Add the following files to it.
    • a/b1/c1
    • a/b1/c2
    • a/b2/c1
    • a/b2/c2
  3. On a Windows machine with a standard Git Bash installation, run the following command.
  4. aws s3api list-objects-v2 --no-paginate --bucket SOME_BUCKET --prefix abc/ --delimiter '/'

Possible Solution

This issue is technically caused by GitBash/Mintty. More context here -- https://stackoverflow.com/questions/58677021

Long story short, GitBash/Mintty tries to be helpful, and replaces all standalone instances of "/" with whatever root folder of Git Bash -- in my case, "C:/Program Files/Git/".

However, this behaviour can be opted out of -- by prepending the command with the following.

MSYS_NO_PATHCONV=1

So, I can change the command to be like this instead.

MSYS_NO_PATHCONV=1 aws s3api list-objects-v2 --no-paginate --bucket SOME_BUCKET --prefix SOME_PREFIX --delimiter '/'

And now, everything works perfectly.

So, I propose that AWS CLI adds a check to see if it is running on MSYS (the underlying system for Mintty/GitBash), and then add this prefix.

It will do no harm and is a very simple change, not to mention it saves an extremely difficult debugging session for the poor soul who has found GitBash/Mintty an otherwise pleasant experience when used with AWS CLI.

Additional Information/Context

This won't just solve the problem for GitBash, but anyone using Mintty. That is a lot of users, and a lot of headache avoided by a not-too-heavy lift from you all.

CLI version used

GitBash -- git version 2.56.0.windows.1

Environment details (OS name and version, etc.)

Microsoft Windows 11 Enterprise -- 10.0.22631 Build 22631

Activity

  1. changed the title [-]Using aws s3api list-objects-v2 --delimiter '/' on Git Bash sets the delimiter as "Delimiter": "C:/Program Files/Git"[/-] [+]Using --delimiter / on Git Bash resolves to "C:/Program Files/Git" instead of "/", regardless of quotes used[/+] on Oct 16, 2026
  2. changed the title [-]Using --delimiter / on Git Bash resolves to "C:/Program Files/Git" instead of "/", regardless of quotes used[/-] [+]Using --delimiter / on Git Bash resolves to "C:/Program Files/Git" instead of "/", regardless of (single/double) quotes used[/+] on Oct 16, 2026
  3. changed the title [-]Using --delimiter / on Git Bash resolves to "C:/Program Files/Git" instead of "/", regardless of (single/double) quotes used[/-] [+]Using --delimiter / on Git Bash resolves to "C:/Program Files/Git" instead of "/", regardless of (single|double) quotes used[/+] on Oct 16, 2026
  4. lazerg commented on Oct 17, 2026

    @lazerg
    Contributor

    This can't be fixed inside the AWS CLI. Git Bash changes the / before it starts aws.exe, so the CLI only ever gets C:/Program Files/Git/ and never sees what you typed (MSYS2 docs). If you want the workaround to stick, add export MSYS_NO_PATHCONV=1 to your ~/.bashrc.

  5. added
    investigatingThis issue is being investigated and/or work is in progress to resolve the issue.
    p2This is a standard priority issue
    and removed
    needs-triageThis issue or PR still needs to be triaged.
    on Oct 20, 2026
  6. added
    needs-reviewThis issue or pull request needs review from a core team member.
    and removed
    investigatingThis issue is being investigated and/or work is in progress to resolve the issue.
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugThis issue is a bug.needs-reviewThis issue or pull request needs review from a core team member.p2This is a standard priority issues3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions