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: init command in .bashrc and .bash_profile fails to run on Windows #845

Open
Doekin opened this issue Mar 3, 2024 · 2 comments
Labels
bug Something isn't working windows Windows specific problem

Comments

@Doekin
Copy link

Doekin commented Mar 3, 2024

Behavior

Git bash launches with error: No such file or directory

bash: C:UsersleemuAppDataRoamingdystroybrootconfiglauncherbashbr: No such file or directory
bash: C:UsersleemuAppDataRoamingdystroybrootconfiglauncherbashbr: No such file or directory

image

Possible cause

The path of init script in .bashrc and .bash_profile contains backslash that is mistakenly parsed as escape character
source C:\Users\leemu\AppData\Roaming\dystroy\broot\config\launcher\bash\br

Possible solution

Quote the path. It works on git bash (Windows10) and bash/zsh (Linux)

@Doekin Doekin added the bug Something isn't working label Mar 3, 2024
@Canop Canop added the windows Windows specific problem label Mar 3, 2024
@Doekin
Copy link
Author

Doekin commented Mar 3, 2024

By the way, init script runs twice when .bashrc and .bash_profile both exists

@AeliusSaionji
Copy link

By the way, init script runs twice when .bashrc and .bash_profile both exists

This is probably a generic issue that deserves its own thread, mind creating that? I imagine it's not Windows specific.

Git bash launches with error: No such file or directory

For clarity: git bash uses a fork of msys2, and this issue falls under the umbrella of Windows cygwin/msys2 problems.

The problem occurs as a result of cygpath.exe's path translation.
image

However, cygpath is correct to do this, because it ensures that paths with spaces in them work correctly.
image

For completion's sake, I should note that forward slash is fine too
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows Windows specific problem
Projects
None yet
Development

No branches or pull requests

3 participants