-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
@edit
on Windows using default editor
#20364
Comments
@edit
on Windows using default editor
The spaces issue is an annoyance of Windows: the Win32 API only allows you to pass a single string for the command-line arguments (rather than passing one string per argument as in Unixy operating systems), and you have to guess at how the program breaks this strings into tokens. See this blog entry, for example. In particular, if the |
This stackoverflow thread says it is a known bug in the |
According to stackoverflow, |
Yes this works for me (Windows 10, I can test on Window 7 later). |
Great! Could you submit a PR? |
Although according to the blog article linked above, we are supposed to put |
dup #7107. at some level, it's probably easier just to write a non-buggy |
It also works on Windows 7. The following also works, but note that
Sure, I can create a PR with
|
I only have a finite amount of time to deal with adding enough hacks to get Windows to be almost feature-complete with Unix. However, since we already have a getopt implementation at https://github.com/JuliaLang/julia/blob/30bf89f3d8e564b588b8e48993e92a551b384f2c/src/getopt.h, any sufficiently motivated developer should be able to make a new repo and start populating it with better implementations of the basic command line tools (starting with a |
LOL |
I just tried: ShellExecute(op, file) =
ccall((:ShellExecuteW,"shell32"), Int, (Ptr{Void}, Cwstring, Cwstring, Ptr{Void}, Ptr{Void}, Cint),
C_NULL, op, file, C_NULL, C_NULL, 10) and |
I just saw this. Let's do this instead of |
use ShellExecuteW rather than cmd for edit function on Windows (closes #20364)
Issue discussed on Discourse https://discourse.julialang.org/t/edit-on-windows/1695
As an example
@edit cmp(1,2)
useswhich runs the command:
I think there are two issues here for the default on Windows:
start
tries runC:\Program
. I tried many variations of extra quoting with single and double quotes but couldn't get it to work.A workaround is:
which runs the command:
For some reason the space is OK in directory /D,
realpath
removes the forward slash.Regarding the forward slash, comment from @nalimilan:
The text was updated successfully, but these errors were encountered: