Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concat process.title instead of overwrite #64

Closed
stevenvachon opened this issue Aug 22, 2014 · 3 comments
Closed

concat process.title instead of overwrite #64

stevenvachon opened this issue Aug 22, 2014 · 3 comments

Comments

@stevenvachon
Copy link

I posted an identical issue to this one for npm.


process.title = "grunt";

overwrites the original title (of "Command Prompt", etc) thereby stripping away our ability to detect which shell is being used on Windows during tests.

process.title += " - grunt";

as node produces (in Windows), would be better.

@sindresorhus
Copy link
Member

👎 That's the point of process.title to be able to clearly show what's currently running. Using that for detecting the type of terminal is fragile as any module or sub-dependency can overwrite it. Find another way. This is not a concern of grunt or npm. There's also a max length of process.title which makes this even more unfeasible.

@stevenvachon
Copy link
Author

Any dependency other than npm/grunt/gulp/etc changing the title is an automatic "don't do that". I did not know about the max length, though, which does pose a problem.

There're only two other solutions:

  1. a native Windows binding to grab the original process/window title
  2. have the Node.js team add a process.env.SHELL or similar for Windows, containing the original process/window title (since the location of the shell executable requires admin)

@vladikoff
Copy link
Member

That's the point of process.title to be able to clearly show what's currently running.

Agreed. pretty sure a lot of modules set process.title. As well as a lot of tools are built around relying on the process title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants