Trying to launch multiple panes crashes WT #9454

Closed
opened 2026-01-31 01:54:55 +00:00 by claunia · 5 comments
Owner

Originally created by @aviatrix on GitHub (Jul 6, 2020).

Environment

Windows build number: 10.0.19041.0
Windows Terminal version : 1.0.1811.0

Steps to reproduce

run

wt -p "PowerShell" -d ./api/ nodemon `; split-pane -V -p "PowerShell" -d ./shop_admin npm run dev `; split-pane -H -p "PowerShell" -d ./shop_frontend_nuxt npm run dev `; focus-tab -t 1

Expected behavior

WT starts 3 panes and runs the 3 commands

Actual behavior

WT starts, opens 3 panes, but they error out with [error 0x80070002 when launching ``npm run dev']

image

Originally created by @aviatrix on GitHub (Jul 6, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.19041.0 Windows Terminal version : 1.0.1811.0 ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> run ```none wt -p "PowerShell" -d ./api/ nodemon `; split-pane -V -p "PowerShell" -d ./shop_admin npm run dev `; split-pane -H -p "PowerShell" -d ./shop_frontend_nuxt npm run dev `; focus-tab -t 1 ``` # Expected behavior WT starts 3 panes and runs the 3 commands # Actual behavior WT starts, opens 3 panes, but they error out with `[error 0x80070002 when launching ``npm run dev']` ![image](https://user-images.githubusercontent.com/151474/86589628-ad32ab00-bf96-11ea-90c6-0ce205403e62.png) <!-- What's actually happening? -->
Author
Owner

@DHowett commented on GitHub (Jul 6, 2020):

These error messages indicate that Terminal cannot find npm or nodemon. Are those in your %PATH% environment variable?

@DHowett commented on GitHub (Jul 6, 2020): These error messages indicate that Terminal cannot find `npm` or `nodemon`. Are those in your `%PATH%` environment variable?
Author
Owner

@aviatrix commented on GitHub (Jul 7, 2020):

@DHowett , Yes npm and nodemon are in my %PATH% systemwide.
I've just opened the path folder for npm, and there are 2 files for each global package like this npm and npm.cmd, nodemon and nodemon.cmd , etc. The files without extensions are bash files. So, i think the console is trying to start those instead of the .cmd files.

i've reworked the command to do this

@echo off
start wt -p "PowerShell" -d ./api/ nodemon.cmd `; split-pane -V -p "PowerShell" -d ./shop_admin npm.cmd run dev `; split-pane -H -p "PowerShell" -d ./shop_frontend_nuxt npm.cmd run dev `;
exit

And it works.

Maybe this needs some NB in the documentation or is it a bug?

@aviatrix commented on GitHub (Jul 7, 2020): @DHowett , Yes `npm` and `nodemon` are in my `%PATH%` systemwide. I've just opened the path folder for npm, and there are 2 files for each global package like this `npm` and `npm.cmd`, `nodemon` and `nodemon.cmd` , etc. The files without extensions are `bash` files. So, i think the console is trying to start those instead of the `.cmd` files. i've reworked the command to do this ```cmd @echo off start wt -p "PowerShell" -d ./api/ nodemon.cmd `; split-pane -V -p "PowerShell" -d ./shop_admin npm.cmd run dev `; split-pane -H -p "PowerShell" -d ./shop_frontend_nuxt npm.cmd run dev `; exit ``` And it works. Maybe this needs some `NB` in the documentation or is it a bug?
Author
Owner

@aviatrix commented on GitHub (Jul 7, 2020):

P.S.
This is the script i've used so far that works as expected :

@echo off
start cmd /k "title GraphQL API && cd ./api && nodemon server"
start cmd /k "title Shop Admin && cd ./shop_admin && npm run dev"
start cmd /k "title Shop FrontEnd Nuxt && cd ./shop_frontend_nuxt && npm run dev"
exit

As you can see no explicit .cmd passed here.

I've also tried using Command Prompt as profile name with .cmd and without, and it also works when there is .cmd and throws an error when there is no .cmd

@aviatrix commented on GitHub (Jul 7, 2020): P.S. This is the script i've used so far that works as expected : ```cmd @echo off start cmd /k "title GraphQL API && cd ./api && nodemon server" start cmd /k "title Shop Admin && cd ./shop_admin && npm run dev" start cmd /k "title Shop FrontEnd Nuxt && cd ./shop_frontend_nuxt && npm run dev" exit ``` As you can see no explicit `.cmd` passed here. I've also tried using `Command Prompt` as profile name with `.cmd` and without, and it also works when there is `.cmd` and throws an error when there is no `.cmd`
Author
Owner

@zadjii-msft commented on GitHub (Jul 7, 2020):

Ah yea, that'll do it. The Terminal cant just call CreateProcess("npm.cmd"), because npm.cmd isn't an executable file. It needs to first launch a process that knows how to run a .cmd file, like cmd or Powershell. Thanks for following up!

@zadjii-msft commented on GitHub (Jul 7, 2020): Ah yea, that'll do it. The Terminal cant just call `CreateProcess("npm.cmd")`, because `npm.cmd` _isn't an executable file_. It needs to first launch a process that knows how to run a `.cmd` file, like `cmd` or Powershell. Thanks for following up!
Author
Owner

@aviatrix commented on GitHub (Jul 7, 2020):

But since I'm specifying profiles Powershell that launches Powershell 7 (same when using Command Prompt), and it has no problem starting npm when i type npm (or anything else really). So my expectation is that it shouldn't need the extra .cmd since it's supposed to run the command npm run dev from PS context. 😕

Edit: my understanding is that I'm trying to run a command with PS (or chosen console profile), not explicitly trying to run this executable
This fails the same way if i try to run dir or ls like this

start wt -p "PowerShell" -d ./ dir `; 

So this explicitly means i cannot pass commands to sub consoles, only executables.

@aviatrix commented on GitHub (Jul 7, 2020): But since I'm specifying profiles `Powershell` that launches Powershell 7 (same when using `Command Prompt`), and it has no problem starting `npm` when i type `npm` (or anything else really). So my expectation is that it shouldn't need the extra `.cmd` since it's supposed to run the command `npm run dev` from PS context. 😕 Edit: my understanding is that I'm trying to run a *command* with PS (or chosen console profile), not explicitly trying to run this *executable* This fails the same way if i try to run `dir` or `ls` like this ``` start wt -p "PowerShell" -d ./ dir `; ``` So this explicitly means i cannot pass commands to sub consoles, only executables.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9454