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

this seems to switch execution context on Windows to Powershell when using "cmd" #303

Open
Pomax opened this issue Mar 11, 2023 · 0 comments

Comments

@Pomax
Copy link

Pomax commented Mar 11, 2023

When using open, even if you run node using cmd instead of powershell, the open function call changes the execution context to powershell, which is... not great? That should just stay cmd.

This is most obvious with some straight foward STR.

  1. Create a file test.js and put the following code in it:
import open from "open"; 
open("https://github.com");
await new Promise(resolve => setTimeout(resolve, 10000));
  1. run cmd and cd to the folder with test.js
  2. run node test.js.

The cmd title bar briefly changes to C:\Windows\System32\cmd.exe - node test.js, then changes to Windows Powershell. Something it really should not be doing. There aren't infinitely many windows-native command line interfaces, detecting that we're in cmd and using that instead of using powershell would be pretty reasonable, given that the code looks like it's already checking whether it's in WSL or not.

@Pomax Pomax changed the title this seems to switch execution context on Windows to Powershell, even when in "cmd" this seems to switch execution context on Windows to Powershell when using "cmd" Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant