Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upprocess title overwrites Windows Command Prompt title #35780
Comments
|
Sorry, I don't see a bug in Node here. The const originalTitle= process.title
process.title = `${originalTitle} - Reticulating splines`if you want your app to restore the title when it exits - then again, you have to do it manually: process.title = originalTitleIf you are unhappy with how some tools use |
|
Yeah, I suspected I would get this response. I had an issue all queued up in Angular CLI's tracker, but had a feeling they would tell me it's Node's problem. It still feels to me like Node is doing something non-standard if I have to go to every tool that's using Node and tell them they're using it wrong. Concatenating the titles to get an OS specific behaviour feels more like something Node should be doing, and not the responsibility of all the tools using Node. Ironically, it works perfectly if the tool doesn't even use |
|
If the tool does not touch |
What steps will reproduce the bug?
cmd.exe)titlecommand (e.g.title My Custom App). The title of the window will change to "My Custom App".process.title = 'Reticulating splines';)Step 2 is actually not necessary to exhibit this bug. You can leave the title as the default "Command Prompt", and the same problem still happens. I only mention using a custom title for the reason stated below in "Additional information".
What is the expected behavior?
Under that scenario, following standard Windows Command Prompt behaviour, while the script is running, the window title should change to "My Custom App - Reticulating splines"
What do you see instead?
Under that scenario, while the script is running, the window title instead changes to "Reticulating splines" only.
Additional information
Angular CLI is an example of a very popular package that uses
process.title, and I use it daily to run multiple sites at once. I set custom titles for each command window, like "Custom App 1", "Custom App 2", etc..., but when I run them all, all the window titles change to "ng build --watch", which makes it really difficult to tell them apart.