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

maktaba#syscall# doesn't work properly for Windows #215

Open
dbarnett opened this issue Jun 23, 2018 · 3 comments
Open

maktaba#syscall# doesn't work properly for Windows #215

dbarnett opened this issue Jun 23, 2018 · 3 comments

Comments

@dbarnett
Copy link
Contributor

dbarnett commented Jun 23, 2018

The syscall support in maktaba tries to force /bin/sh when it checks if the shell value is usable, and doesn't work properly on Windows. Configuring it to allow cmd might help, but there may be other assumptions on what syntax the shell supports that won't work properly with Windows' cmd program.

When users are running into this issue, the symptom is that syscalls are failing with E484: Can't open file C:\Users\<me>\AppData\Local\Temp\VIoFBAB.tmp.

@dbarnett
Copy link
Contributor Author

dbarnett commented Jun 23, 2018

Should be able to work around the shell override by adding

call maktaba#syscall#SetUsableShellRegex('\v^/bin/sh|cmd|cmd\.exe|command\.com$')

to your vimrc after maktaba is loaded, and then vim will at least try to use cmd.

@dbarnett
Copy link
Contributor Author

In general, we should try to detect and give a better error when the shell doesn't exist. The vim error from system() for that case isn't great... I see a subtle "Cannot execute shell" followed by a bright red error like E484: Can't open file /tmp/vysbXL0/5.

@dbarnett
Copy link
Contributor Author

dbarnett commented Apr 4, 2020

I tried firing up Wine and installing vim but I can't even figure out how to get it to invoke any shell command. I tried

:set shell=cmd.exe
:echo system('dir')

and a bunch of variations on that with different shell settings and :! instead of system(). Also, strangely, the shell setting defaults to /bin/bash for me (I guess from the host Linux system) and :echo executable(&shell) returns true but actually trying to execute it doesn't work. Maybe Wine isn't the best environment to try to get something working here…

I don't want to break it for anyone on Windows that somehow has it working but I can't do much for people reporting weird errors. Maybe I could soft-disable it with a meaningful warning message that tells you "If you want to try to get it working, do XYZ to enable it and then follow up on #215 to discuss how it's working for you"…

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

No branches or pull requests

1 participant