Tab title changes to C:\WINDOWS\system32\cmd.exe once I do npm run dev #14389

Closed
opened 2026-01-31 04:08:59 +00:00 by claunia · 7 comments
Owner

Originally created by @deadcoder0904 on GitHub (Jul 4, 2021).

Windows Terminal version (or Windows build number)

1.8.1521.0

Other Software

No response

Steps to reproduce

Just install a new Next.js project using https://nextjs.org/docs/getting-started#setup & run npm run dev in Terminal.

You'll see the terminal name changes to C:\WINDOWS\system32\cmd.exe

Expected Behavior

I want the terminal name to be the folder name just like it is in all the other terminals. Even Git Bash has the cwd as the terminal name.

Actual Behavior

Terminal name is C:\WINDOWS\system32\cmd.exe

Originally created by @deadcoder0904 on GitHub (Jul 4, 2021). ### Windows Terminal version (or Windows build number) 1.8.1521.0 ### Other Software _No response_ ### Steps to reproduce Just install a new Next.js project using https://nextjs.org/docs/getting-started#setup & run `npm run dev` in Terminal. You'll see the terminal name changes to `C:\WINDOWS\system32\cmd.exe` ### Expected Behavior I want the terminal name to be the folder name just like it is in all the other terminals. Even Git Bash has the `cwd` as the terminal name. ### Actual Behavior Terminal name is `C:\WINDOWS\system32\cmd.exe`
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 04:08:59 +00:00
Author
Owner

@skyline75489 commented on GitHub (Jul 4, 2021):

Does #8448 helps explaining this?

@skyline75489 commented on GitHub (Jul 4, 2021): Does #8448 helps explaining this?
Author
Owner

@deadcoder0904 commented on GitHub (Jul 5, 2021):

It explains that it is not possible & says that npm should fix it but I'm really not sure if it's an npm issue as rest of the terminals work fine.

@deadcoder0904 commented on GitHub (Jul 5, 2021): It explains that it is not possible & says that `npm` should fix it but I'm really not sure if it's an `npm` issue as rest of the terminals work fine.
Author
Owner

@DHowett commented on GitHub (Jul 8, 2021):

Thanks for the report! If you don't want the application to be able to control (or reset!) the title, you may want to enable this setting:

image

@DHowett commented on GitHub (Jul 8, 2021): Thanks for the report! If you don't want the application to be able to control (or reset!) the title, you may want to enable this setting: ![image](https://user-images.githubusercontent.com/189190/124981373-1b230f80-dffb-11eb-9fe5-c1b72cd86a6b.png)
Author
Owner

@deadcoder0904 commented on GitHub (Jul 9, 2021):

@DHowett is there a way to set the folder name on the title? There is a Tab Title property but I can't get it to point to cwd or pwd. I tried using %__CD__% & %__CURRENT_DIRECTORY__% which I found online but it doesn't work. Google doesn't help much.

image

@deadcoder0904 commented on GitHub (Jul 9, 2021): @DHowett is there a way to set the folder name on the title? There is a `Tab Title` property but I can't get it to point to `cwd` or `pwd`. I tried using `%__CD__%` & `%__CURRENT_DIRECTORY__%` which I found online but it doesn't work. Google doesn't help much. ![image](https://user-images.githubusercontent.com/16436270/125025808-f4b7af80-e0a0-11eb-81de-9d595c3a4776.png)
Author
Owner

@deadcoder0904 commented on GitHub (Jul 9, 2021):

It seems like this is the solution.

function Prompt
{
  $host.ui.RawUI.WindowTitle = $(get-location)
  “PS> “
}

But idk where do I put it?

@deadcoder0904 commented on GitHub (Jul 9, 2021): It seems like [this is the solution](https://devblogs.microsoft.com/powershell/setting-the-console-title-to-be-your-current-working-directory/). ``` function Prompt { $host.ui.RawUI.WindowTitle = $(get-location) “PS> “ } ``` But idk where do I put it?
Author
Owner

@skyline75489 commented on GitHub (Jul 9, 2021):

@deadcoder0904 Try put it in where echo $PROFILE shows you.

@skyline75489 commented on GitHub (Jul 9, 2021): @deadcoder0904 Try put it in where `echo $PROFILE` shows you.
Author
Owner

@deadcoder0904 commented on GitHub (Jul 9, 2021):

Thanks, @skyline75489 that works but the solution is incorrect. Mind pointing me out to setting Tab title to cwd or pwd? Again, Googling leads to useless results.

@deadcoder0904 commented on GitHub (Jul 9, 2021): Thanks, @skyline75489 that works but the solution is incorrect. Mind pointing me out to setting Tab title to `cwd` or `pwd`? Again, Googling leads to useless results.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14389