feat(cli): set terminal title to project name#988
Open
zerone0x wants to merge 1 commit intovoidzero-dev:mainfrom
Open
feat(cli): set terminal title to project name#988zerone0x wants to merge 1 commit intovoidzero-dev:mainfrom
zerone0x wants to merge 1 commit intovoidzero-dev:mainfrom
Conversation
Instead of showing just "vp" as the terminal window title, read the project name from the nearest package.json and set it as the terminal title using the OSC 0 escape sequence. This applies to both the global CLI and the local CLI entry points. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for viteplus-preview canceled.
|
fengmk2
reviewed
Mar 17, 2026
| pub fn set_terminal_title(title: &str) { | ||
| use std::io::Write; | ||
|
|
||
| if !std::io::stdout().is_terminal() || std::env::var_os("CI").is_some() { |
Member
There was a problem hiding this comment.
Will there be similar issues to #986? Under what conditions would title not be supported?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
package.jsonand set it as the terminal window title using the OSC 0 escape sequence (ESC ] 0 ; <title> BEL)vpbinary) and the local CLI entry pointpackage.jsonwith anamefield is foundFixes #978
Test plan
vite_sharedtests pass (31 passed, 1 ignored)vp devin a project directory and verify the terminal tab/window title shows the project name instead of "vp"vpoutside any project directory and verify no error occurs (graceful fallback)🤖 Generated with Claude Code