Skip to content

feat: config option for terminal/shell title prefixes of package name#9219

Open
richard-green wants to merge 4 commits intonpm:latestfrom
richard-green:prefix-package-name-in-title
Open

feat: config option for terminal/shell title prefixes of package name#9219
richard-green wants to merge 4 commits intonpm:latestfrom
richard-green:prefix-package-name-in-title

Conversation

@richard-green
Copy link
Copy Markdown

Summary

Adds a config option, prefix-package-name-in-title, to include the package name in the terminal window's title bar.

npm config set prefix-package-name-in-title true

Motivation

When working across multiple projects simultaneously, it can be quite confusing remembering which tab is running which project - this new optional config item will prefix the titlebars of the terminal with the package name:

image

Changes

  • Added prefix-package-name-in-title config item as a boolean
  • Assuming you have a package name set in package.json, this will form the prefix for the titlebar

@richard-green richard-green requested a review from a team as a code owner April 11, 2026 21:47
@richard-green richard-green force-pushed the prefix-package-name-in-title branch from b94a227 to 9e4a859 Compare April 25, 2026 09:35
@richard-green richard-green force-pushed the prefix-package-name-in-title branch from 9e4a859 to bc9410f Compare April 25, 2026 09:47
Comment thread lib/npm.js
// configuration to enable the terminal title to be prefixed with the project's name.
let titlePrefix = []
if (this.config.get('prefix-package-name-in-title')) {
const { content } = await pkgJson.normalize(this.localPrefix)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a LOT of overhead to add to every npm invocation.

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

Successfully merging this pull request may close these issues.

2 participants