error 2147942402 (0x80070002) exception occurs when launching the panel and executing multiple commands #18978

Closed
opened 2026-01-31 06:30:13 +00:00 by claunia · 7 comments
Owner

Originally created by @xianghongai on GitHub (Nov 29, 2022).

Windows Terminal version

1.15.2874.0

Windows build number

10.0.19044.2193

Other Software

No response

Steps to reproduce

  1. wt -p "Git Bash" ssh -i ~/.ssh/id_rsa xxxxxx@xxx.xx.xxx.xxx "cd /home/project/feature; yarn -v; node -v"; split-pane -V -p "Git Bash" ssh -i ~/.ssh/id_rsa xxxxxx@xxx.xx.xxx.xxx "cd /home/project2; yarn -v; node -v" → Enter
  2. [error 2147942402 (0x80070002) when launching `" node -v"']

start multiple panels via wt, each panel executing multiple commands.

Expected Behavior

Login, enter /home/project/feature, and then run yarn -v, and then run node -v.

Actual Behavior

An exception occurs.

Originally created by @xianghongai on GitHub (Nov 29, 2022). ### Windows Terminal version 1.15.2874.0 ### Windows build number 10.0.19044.2193 ### Other Software _No response_ ### Steps to reproduce 1. `wt -p "Git Bash" ssh -i ~/.ssh/id_rsa xxxxxx@xxx.xx.xxx.xxx "cd /home/project/feature; yarn -v; node -v"; split-pane -V -p "Git Bash" ssh -i ~/.ssh/id_rsa xxxxxx@xxx.xx.xxx.xxx "cd /home/project2; yarn -v; node -v"` → Enter 2. <code>[error 2147942402 (0x80070002) when launching `" node -v"']</code> start multiple panels via `wt`, each panel executing multiple commands. ### Expected Behavior Login, enter `/home/project/feature`, and then run `yarn -v`, and then run `node -v`. ### Actual Behavior An exception occurs.
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 06:30:13 +00:00
Author
Owner

@xianghongai commented on GitHub (Nov 29, 2022):

  1. CMD wt -p "Git Bash" ssh -i ~/.ssh/id_rsa xxxxxx@xxx.xx.xxx.xxx "/home/project/feature/start.sh"; split-pane -V -p "Git Bash" ssh -i ~/.ssh/id_rsa xxxxxx@xxx.xx.xxx.xxx "/home/project/feature2/start.sh" → Enter
  2. started as expected
  3. However, when Ctrl+C is forced to end and exit, an exception occurs: [process exited with code 4294967295 (0xffffffff)]
@xianghongai commented on GitHub (Nov 29, 2022): 1. CMD `wt -p "Git Bash" ssh -i ~/.ssh/id_rsa xxxxxx@xxx.xx.xxx.xxx "/home/project/feature/start.sh"; split-pane -V -p "Git Bash" ssh -i ~/.ssh/id_rsa xxxxxx@xxx.xx.xxx.xxx "/home/project/feature2/start.sh"` → Enter 2. started as expected 3. However, when `Ctrl+C` is forced to end and exit, an exception occurs: `[process exited with code 4294967295 (0xffffffff)]`
Author
Owner

@xianghongai commented on GitHub (Nov 29, 2022):

  1. If something goes wrong inside the .sh file, the exception occurs: [process exited with code 1 (0x00000001)]
@xianghongai commented on GitHub (Nov 29, 2022): 4. If something goes wrong inside the `.sh` file, the exception occurs: `[process exited with code 1 (0x00000001)]`
Author
Owner

@zadjii-msft commented on GitHub (Nov 29, 2022):

You might want to try escaping the ; characters in that commandline. wt will treat them as separators between subcommands, so your commandline in the OP gets treated as: ({{new-tab}} showing the implied subcommands)

  • {{new-tab}} -p "Git Bash" ssh -i ~/.ssh/id_rsa xxxxxx@xxx.xx.xxx.xxx "cd /home/project/feature
  • {{new-tab}} yarn -v
  • {{new-tab}} node -v"
  • split-pane -V -p "Git Bash" .... more of the same.

4. If something goes wrong inside the .sh file, the exception occurs: [process exited with code 1 (0x00000001)]

See: Why am I seeing [process exited with code ...]?

@zadjii-msft commented on GitHub (Nov 29, 2022): You might want to try escaping the `;` characters in that commandline. `wt` will treat them as separators between subcommands, so your commandline in the OP gets treated as: (`{{new-tab}}` showing the implied subcommands) * `{{new-tab}} -p "Git Bash" ssh -i ~/.ssh/id_rsa xxxxxx@xxx.xx.xxx.xxx "cd /home/project/feature` * `{{new-tab}} yarn -v` * `{{new-tab}} node -v"` * `split-pane -V -p "Git Bash" ....` more of the same. > 4\. If something goes wrong inside the `.sh` file, the exception occurs: `[process exited with code 1 (0x00000001)]` See: [Why am I seeing `[process exited with code ...]`?](https://github.com/microsoft/terminal/wiki/Frequently-Asked-Questions-(FAQ)#why-am-i-seeing-process-exited-with-code-)
Author
Owner

@xianghongai commented on GitHub (Nov 30, 2022):

it is so.

wt -p "Git Bash" ssh -t -i ~/.ssh/id_rsa xxx@xx.xx.xxx.xxx "cd /home/projects/feature && exec /bin/sh"; ^
split-pane -V -p "Git Bash" ssh -t -i ~/.ssh/id_rsa xxx@xx.xx.xxx.xxx "cd /home/projects/feature && yarn -v && node -v && exec /bin/sh"; ^
split-pane -H -p "Git Bash" ssh -t -i ~/.ssh/id_rsa xxx@xx.xx.xxx.xxx "cd /home/projects/feature && yarn -v && node -v && exec /bin/sh"; ^
split-pane -H -p "Git Bash" ssh -t -i ~/.ssh/id_rsa xxx@xx.xx.xxx.xxx "cd /home/projects/feature && yarn -v && node -v && exec /bin/sh"; ^
split-pane -H -p "Git Bash" ssh -t -i ~/.ssh/id_rsa xxx@xx.xx.xxx.xxx "cd /home/projects/feature && yarn -v && node -v && exec /bin/sh";

@xianghongai commented on GitHub (Nov 30, 2022): it is so. ```bash wt -p "Git Bash" ssh -t -i ~/.ssh/id_rsa xxx@xx.xx.xxx.xxx "cd /home/projects/feature && exec /bin/sh"; ^ split-pane -V -p "Git Bash" ssh -t -i ~/.ssh/id_rsa xxx@xx.xx.xxx.xxx "cd /home/projects/feature && yarn -v && node -v && exec /bin/sh"; ^ split-pane -H -p "Git Bash" ssh -t -i ~/.ssh/id_rsa xxx@xx.xx.xxx.xxx "cd /home/projects/feature && yarn -v && node -v && exec /bin/sh"; ^ split-pane -H -p "Git Bash" ssh -t -i ~/.ssh/id_rsa xxx@xx.xx.xxx.xxx "cd /home/projects/feature && yarn -v && node -v && exec /bin/sh"; ^ split-pane -H -p "Git Bash" ssh -t -i ~/.ssh/id_rsa xxx@xx.xx.xxx.xxx "cd /home/projects/feature && yarn -v && node -v && exec /bin/sh"; ```
Author
Owner

@PankajBhojwani commented on GitHub (Nov 30, 2022):

it is so.

Could you please elaborate on what you mean by that?

So there seem to be a few different issues here:

  1. Having ;s inside "" (tracked at #13264, should be solved by @zadjii-msft's comment above on escaping the ;s)
  2. Seeing the exit code when processes exit (this is not always an error code, it is just the exit code - changing your Profile termination behavior setting will change whether you see this or whether the session just closes. The setting is found in Profile -> Advanced)
@PankajBhojwani commented on GitHub (Nov 30, 2022): > it is so. Could you please elaborate on what you mean by that? So there seem to be a few different issues here: 1. Having `;`s inside `""` (tracked at #13264, should be solved by @zadjii-msft's comment above on escaping the `;`s) 2. Seeing the exit code when processes exit (this is not always an error code, it is just the exit code - changing your `Profile termination behavior` setting will change whether you see this or whether the session just closes. The setting is found in Profile -> Advanced)
Author
Owner

@xianghongai commented on GitHub (Dec 1, 2022):

Is such that:

  1. Windows terminal starts multiple panels;
  2. In each panel, ssh logs in to the remote host;
  3. Open the directory on the remote host and execute multiple commands; such as npm run serve or yarn start; the terminal cannot exit;

In the ssh syntax, it is like this: ssh <user>@<host> "command1; command2; command3", there is a semicolon ; in it, and wt is abnormal when parsing.

Replace ; with && and there will be no exception.

If command1 is node start --port=7000 --workspace-root-path=/<path> --dev-server-settings-path=/<path> -proxy-config-path=/<path> Such complex instructions, There will be exceptions, we need wt -p "Git Bash" ssh -i ~/.ssh/id_rsa <user>@<host> ; to log in to the remote host, and then manually copy it in and execute it.

@xianghongai commented on GitHub (Dec 1, 2022): Is such that: 1. Windows terminal starts multiple panels; 2. In each panel, ssh logs in to the remote host; 3. Open the directory on the remote host and execute multiple commands; such as `npm run serve` or `yarn start`; the terminal cannot exit; In the ssh syntax, it is like this: `ssh <user>@<host> "command1; command2; command3"`, there is a semicolon `;` in it, and `wt` is abnormal when parsing. Replace `;` with `&&` and there will be no exception. If `command1` is `node start --port=7000 --workspace-root-path=/<path> --dev-server-settings-path=/<path> -proxy-config-path=/<path> ` Such complex instructions, There will be exceptions, we need `wt -p "Git Bash" ssh -i ~/.ssh/id_rsa <user>@<host> ;` to log in to the remote host, and then manually copy it in and execute it.
Author
Owner

@DHowett commented on GitHub (Dec 1, 2022):

Windows Terminal does not treat " differently from other characters. Therefore, you need to use \; even if it is inside "".

This is because Terminal wants to send the " directly to the command it is invoking.

@DHowett commented on GitHub (Dec 1, 2022): Windows Terminal does not treat `"` differently from other characters. Therefore, you need to use `\;` even if it is inside `""`. This is because Terminal wants to send the `"` directly to the command it is invoking.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18978