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

Unable to spawn Code via child_process.exec #570

Closed
seanmcbreen opened this issue Nov 24, 2015 · 5 comments
Closed

Unable to spawn Code via child_process.exec #570

seanmcbreen opened this issue Nov 24, 2015 · 5 comments
Assignees

Comments

@seanmcbreen
Copy link

From @alefragnani on November 12, 2015 15:44

When I try to spawn another Code instance using child_process.exec, nothing happens (neither an error).

    exec('start \"open ui\" "C:\\Program Files\\Microsoft VS Code\\Code.exe" "C:\\Program Files\\Winmerge\\Files.txt"').

Original from issue #84

Copied from original issue: Microsoft/vscode-extensionbuilders#101

@seanmcbreen
Copy link
Author

From @Tyriar on November 13, 2015 6:38

I was looking into the same thing you were and I think this is the case because you cannot currently have more than 1 instance of Code open at once. At least on Windows 10, shift+clicking on the app icon or running code again in command prompt doesn't do anything.

@seanmcbreen
Copy link
Author

From @bpasero on November 13, 2015 7:53

No thats ok, we detect this case with a socket and communicate to the first instance.

@seanmcbreen
Copy link
Author

From @alefragnani on November 13, 2015 9:38

@Tyriar in fact you can, but you have to pass a new folder / file via parameter, while running in Command Prompt.

  • Running Code "a_folder" will open Code with a_folder
  • Running Code (with no parameter) will reactivate the last focused/active Code instance
  • Running Code . (with a dot) will open Code on the current folder.

This issue is while running Code via child_process.exec, inside a Code extension.

@seanmcbreen
Copy link
Author

From @mikiest on November 13, 2015 9:43

As mentioned earlier, I think a supported way to open a new instance and/or in the same window, with a folder/file target would be better instead of having to use child_process.exec.

Maybe something like vscode.open(path:string, newWindow:boolean))?

I confirm I can reproduce the initial issue on my Windows 10, by the way.

@bpasero
Copy link
Member

bpasero commented Nov 25, 2015

We will work on providing a way to open a folder from an extension. Closing.

@bpasero bpasero closed this as completed Nov 25, 2015
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@bpasero @seanmcbreen and others