wlwl2 / open-file

An Atom package that allows users to open files in their respective default app.
MIT License
3 stars 1 forks source link

File does not open in the default app #10

Open TimBunk opened 4 years ago

TimBunk commented 4 years ago

So I am trying to open a lua script using a tool that executes lua code. So I made that tool the default app of every lua script and it works fine but when I try to open the lua script through your package nothing happends.

Atom_open_file_in

I changed the default app of every lua script to notepad to see if I would get the same result but apparently it does work with notepad but not with the lua tool that I want it to open with.

wlwl2 commented 4 years ago

I should probably say early. I've been very busy this particular end of the month. Hopefully I'll remember to do a check on this again.

TimBunk commented 4 years ago

lua_tool.zip Thank you for your responds. I uploaded the lua tool that I was talking about so you can reproduce the problem. Also I added a test.lua script to help you reproduce the problem that I am having. Please let me know if you can fix this problem or not. Me and my friend that I am teaching lua would love for this to work!

wlwl2 commented 4 years ago

I basically can't fix this. I suspect that the issue is either the Windows operating system or Node.js. I tried to run start "path/to/test.lua" using Child Process exec- that doesn't work. But that command works on both command prompt and powershell. Node.js using command prompt by default (cmd.exe and process.env.ComSpec) also worries me.

wlwl2 commented 3 years ago

Oops, I meant to say that I didn't have time to fix it quickly. I'm having a quick look at this issue again right now. What I think I can do (when I do get the time), is open up a terminal, and then run the start command with your lua file. If you manage to read this comment in time, would that be enough? If it isn't, then a fix won't be easy as the problem might be Node.js or maybe Windows 10.

wlwl2 commented 3 years ago

I'll wait for your reply first, because maybe you've found a workaround or no longer want/need it. But I still want to provide options where users can open a terminal (powershell, macOS terminal, Linux terminal etc.) first, and then do the start/open or whatever command to open another file (if I have time 😟).

TimBunk commented 3 years ago

I no longer need this feature as I am not working with Lua anymore but thanks anyway for picking it up again. I did had a workaround for this issue and that was to set a PATH in windows 10 to the "lua.exe". So I could just open cmd and type "lua test.lua" to execute the script.