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
Terminal can't be opened in Windows 10. #5
Comments
Thank you so much for sharing this elaborate report Michal. I assume we could perhaps add the Windows terminal emulators programs to the list like we see in https://github.com/lirantal/opn-shell/blob/master/lib/TerminalLauncher.js#L10 ? I don't have a Windows machine easily accessible so it would be a bit of a trail&error for me to get this right. Would you be able to clone this lib and try it out with I'd be happy to merge a PR to add it if you can work it out. |
Adding terminals to the list won't work well because we will still get message box with error for each terminal that is missing. This is working nicely on linux because nothing is displayed in case of missing executable in PATH. I'll try to come up with something soon 🙂 |
Oh, I realized that this is what you meant. Sorry missed that in the original report. Well, I think it might be an easy one to solve. I can attempt to detect the OS, if the OS is Windows then I use Actually, that's not the only thing since the script itself is for bash, so even if we had successfully detected I'm here to support any way I can! |
I've been looking into it today and I'm starting to believe that supporting this feature is impossible with 'opn'. When passing 'cmd' or 'powershell' to opn, scripts are executed in the background - no visible terminal is spawned. When explicitly using "start" command, terminal windows are spawned but the child process spawned by nodejs seems to never exit, because underlying shell is not closed - promises are never fulfilled/rejected and nodejs process does not finish. Working around this line seems not to be worth it, so I'm going to re-work it a little bit. Linux support will work the same way but windows handlers are going to use bare child_process |
It sounds ok to me to fallback to child_process for Windows. |
nvm, after writing that I realized that it would be too lazy. |
Awesome thanks! Will check out the PR soon |
Terminal can't be opened in Windows 10 and method for detecting terminals creates a lot of error message windows.
Expected Behavior
Terminal is opened.
Current Behavior
Following message is displayed for every terminal supported by this library. Finally, target script file is opened in VS Code (I think because it is the default file editor on my PC).
Possible Solution
Detect default terminal executable from system settings instead of using brute-force.
I think that such path is stored in 'ComSpec' env variable in windows.
Context
I tried to attach terminal to my container using "dockly". After investigating the code I noticed that this is caused by this library.
Your Environment
The text was updated successfully, but these errors were encountered: