Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

When using bash (git or cygwin) in Windows, it should be treated as bash, not cmd #26

Open
matey-jack opened this issue Nov 30, 2015 · 7 comments

Comments

@matey-jack
Copy link
Contributor

No description provided.

@esc
Copy link
Contributor

esc commented Dec 2, 2015

Can you expand on this a little, not sure exactly what you mean?

@mriehl
Copy link

mriehl commented Dec 2, 2015

I think the problem is cli looks at os.name to detect the suitable export format instead of being shell specific.

Same for spawning a subshell.

@matey-jack
Copy link
Contributor Author

yes, exactly. I looked for ways to detect if bash is there, but windows doesn't have the SHELL env variable (or at least with gitbash it's not there) and no other env variable gives a clue.
I have thought about searching PATH for bash, but not looked into the details and drawbacks of this approach.

Currently our usecase disappeared, which is why I am not working on it any more.

@esc
Copy link
Contributor

esc commented Dec 2, 2015

As a workaround, we could define a config-file parameter to force the export format regardless of os.name .. Not perfect, but would put the user in control.

On 2 December 2015 18:02:36 CET, Robert Jack Will notifications@github.com wrote:

yes, exactly. I looked for ways to detect if bash is there, but windows
doesn't have the SHELL env variable (or at least with gitbash it's not
there) and no other env variable gives a clue.
I have thought about searching PATH for bash, but not looked into the
details and drawbacks of this approach.

Currently our usecase disappeared, which is why I am not working on it
any more.


Reply to this email directly or view it on GitHub:
#26 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@sdomme
Copy link
Contributor

sdomme commented Dec 3, 2015

Maybe there is a way to get it from the hidden variable CMDCMDLINE.

echo %CmdCmdLine%
"C:\Windows\system32\cmd.exe"

I'm done with Windows so can't test it.

@esc
Copy link
Contributor

esc commented Dec 30, 2015

there should be an override switch (and config-file option), like -f, --force-os that allows you to disregard any automatic detection of the operating system. Should be trivial enough to implement.

@schlomo
Copy link
Contributor

schlomo commented Jan 26, 2016

If the user wants to set the shell (bash, zsh, CMD.EXE ...) then why not give a parameter and config file item for just that? In the end the shell type determines how we have to call it and inject the variables.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants