terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Degradation with multiple tabs and using `nvm`

Open Filyus opened this issue 2 years ago • 1 comments

Windows Terminal version

1.15.2874.0

Windows build number

10.0.19045.2251

Other Software

Steps to reproduce

  1. Download and run nvm-setup.exe from nvm-windows releases page
  2. Insall Node.js 16.17.0 via nvm-windows:
    nvm install 16.17.0
  3. Install NestJS: npm i -g @nestjs/cli
  4. Create projects:
cd /d C:\

nest new project-1
# select `npm` and press `Enter`

nest new project-2
# select `npm` and press `Enter`

nest new project-3
# select `npm` and press `Enter`
  1. Create a start.bat file to run 3 tabs with the created projects:
wt new-tab --title "Project 1" --suppressApplicationTitle -d "C:/project-1/" "%APPDATA%\nvm\v16.17.0\npm.cmd run start:dev"; new-tab --title "Project 2" --suppressApplicationTitle -d "C:/project-2/" "%APPDATA%\nvm\v16.17.0\npm.cmd run start:dev"; new-tab --title "Project 3" --suppressApplicationTitle -d "C:/project-3/" "%APPDATA%\nvm\v16.17.0\npm.cmd run start:dev"; focus-tab -t 0
  1. Set Startup > New instance behavior to Create a new window
  2. Close all the Windows Terminal instances
  3. Run start.bat

Expected Behavior

  1. Only one window is opened
  2. 3 tabs with correct titles is opened (specified in bat-file)
  3. The titles do not change over time
  4. Tabs order is same as in bat-file
  5. Focus changed to the first tab
  6. Every project in every tab is immediately started
  7. Closing Windows Terminal stops node instances
  8. Working with npm run dev inside of bat-file

Actual Behavior

  1. 3 windows instead of 1 is started (can be fixed by Startup > New instance behavior > Attach to the most recently used window setting, but this is dirty!)
  2. Titles is not always correct (some randomness here)
  3. Titles change to "Default" over time
  4. Tabs order is random
  5. Focus to the first tab is not changed, a last tab is focused
  6. Project in the first opened tab is not started while you not switch to that tab manualy
  7. Closing Windows Terminal don't stops node instances
  8. Full path of npm must be specified because of symbol link from C:\Program Files\nodejs to %APPDATA%\nvm\v16.17.0\ directory

Filyus avatar Dec 02 '22 09:12 Filyus

Related issue: https://github.com/microsoft/terminal/issues/9628

This successfully runs with cmd /k and with disabled Run this profile as Administrator option or with a created shotcut to the bat-file with an enabled property Advanced > Run as administrator.

wt -w MyProject new-tab --title "Project 1" --suppressApplicationTitle -d "C:/project-1/" cmd /k "npm run start:dev"; new-tab --title "Project 2" --suppressApplicationTitle -d "C:/project-2/" cmd /k "npm run start:dev"; new-tab --title "Project 3" --suppressApplicationTitle -d "C:/project-3/" cmd /k "npm run start:dev"; focus-tab -t 0

Filyus avatar Dec 20 '22 07:12 Filyus

Commandline args actually use the same code as startupActions. So we're going to mark this as a /dup of #14442. Thanks.

carlos-zamora avatar Jan 25 '23 22:01 carlos-zamora

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

ghost avatar Jan 25 '23 22:01 ghost

This is not a duplicate. Here are 8 (!) issues that are only hides by changing the administrator stuff. This doesn't mean that these issues don't need to be fixed. Please don't lose sight of them.

For example, my tab titles change by themselves to "Command Promt" now (like in an issue number 3 in the list above).

Filyus avatar Jan 26 '23 16:01 Filyus

(For what it's worth, we do try to avoid having "blanket bugs" - it makes tracking them surprisingly difficult. After all: they do not represent indivisible units of work...) I would reckon that at least six of them are already tracked in the approx. 1500 open issues, it's just that we have not gone back and looked up all of those duplicates.

Sorry for the inconvenience, and thank you for following up :)

DHowett avatar Jan 26 '23 18:01 DHowett