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

msys2 fish-shell invoke cmd error #9455

Closed
wolfand11 opened this issue Jan 9, 2023 · 6 comments
Closed

msys2 fish-shell invoke cmd error #9455

wolfand11 opened this issue Jan 9, 2023 · 6 comments
Labels

Comments

@wolfand11
Copy link

wolfand11 commented Jan 9, 2023

fish version 3.5.0

when i invoke pyenv command with msys2 fish shell, it's always "Microsoft Windows ......". when i invoke pyenv with msys bash shell it's ok!

image

image

Finally, i find that invoke cmd command with msys2 fish shell always results "Microsoft Windows ......"
image

@wolfand11 wolfand11 changed the title msys2 fish-shell invoke pyenv error msys2 fish-shell invoke cmd error Jan 9, 2023
@faho
Copy link
Member

faho commented Jan 9, 2023

The msys fish package is at version 3.5.1-2, not 3.5.0. You probably upgraded the rest of your system but not fish. Upgrade fish as well.

This is plausible because the error you are getting is

cygheap base mismatch detected
This problem is probably due to using incompatible versions of the cygwin DLL

So it looks like fish is looking for the wrong DLL.

If you compiled fish yourself, you'll need to recompile it.

@faho faho added the question label Jan 9, 2023
@wolfand11
Copy link
Author

wolfand11 commented Jan 10, 2023

@faho thanks for your response.

i upgrade my msys. and then upgrade fish use below command:

pacman -S fish

but, it's not work.

image

@faho
Copy link
Member

faho commented Jan 10, 2023

cmd is not a fish thing, it's a windows command. Fish simply executes it and gives it its arguments.

You probably want cmd /c test.bat (no "./", or it'll be confused).

@wolfand11
Copy link
Author

wolfand11 commented Jan 11, 2023

@faho i find a same problem. #6257

i need add some package to support bat ?

image
image
image

@faho
Copy link
Member

faho commented Jan 11, 2023

If cmd /c test.bat fails, you'll want to ask a cygwin person.

The reason running ./test.bat fails is because fish checks if the file is executable before running it and your system tells us it isn't - bash handles this differently by just blindly running it, and it has special handling for cygwin to run bat files, we don't. Googling said this worked by automatically running cmd /c foo.bat if executing failed (similar to how we run /bin/sh), if that's not it I am out of ideas.

I'm going to have to send you to the msys/cygwin people.

@faho faho closed this as completed Jan 11, 2023
@wolfand11
Copy link
Author

@faho the problem is solved!

replace 'cmd /c "pyenv --version" ' with 'cmd //c "pyenv --version" '

image

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

No branches or pull requests

2 participants