Repository navigation
feat: support the hide method for configuring long git branch names - #16663
Open
wzc520pyfm wants to merge 3 commits into
Open
wzc520pyfm wants to merge 3 commits into
wzc520pyfm wants to merge 3 commits into
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @cursoragent on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
Contributor
Author
|
@cla-bot check |
Long branch names were always truncated from the start, which hides ticket prefixes. Add a truncation-direction setting and an optional display regex, with Features settings and a command palette toggle. Co-authored-by: wzc520pyfm <1528857653@qq.com>
The features page is mid-update while the editor blur or enter event is delivered, so a synchronous typed-action dispatch never reached the handler and the pattern was discarded. Co-authored-by: wzc520pyfm <1528857653@qq.com>
Drop the display regex. The prompt still hides the start of a long name by default, and a setting can hide the end instead. A separate pair of character counts hides the middle while keeping both edges. Co-authored-by: wzc520pyfm <1528857653@qq.com>
cursor
Bot
force-pushed
the
wzc520pyfm/git-branch-prompt-display
branch
from
October 28, 2026 06:17
4e58df3 to
5127c82
Compare
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.
Description
Long git branch names in the prompt chip are still shortened to 40 characters. The hidden part is still replaced with an ellipsis. The default continues to hide the start of the name.
Settings → Features → Terminal now has two controls:
…ng-feature-that-needs-to-be-implementedABC-123-some-long-feature-that-needs-to…ABC-123-some…-implementedThe command palette can switch between hiding the start and hiding the end. Hiding the middle is chosen from the dropdown. The same formatting applies to the git branch status chip.
In
settings.toml:terminal.prompt.git_branch_name_truncation:omit_start(default),omit_end, oromit_middleterminal.prompt.git_branch_name_prefix_chars: default12terminal.prompt.git_branch_name_suffix_chars: default12The middle commit on this branch mentions a display pattern. The final diff uses the character counts above instead.
Linked Issue
#16634
ready-to-specorready-to-implement.The issue is triaged and reproducible, and it does not currently have
ready-to-specorready-to-implement.Testing
./script/runAdded
app/src/util/git_branch_display_tests.rs. It covers the existing start-hiding behavior, end hiding, middle hiding, the 40-character cap, unicode boundaries, and the settings values.cargo test -p warp --lib -- git_branch_display file_defaults_validate_against_schema— 13 passedcargo clippy -p warp --lib --tests -- -D warningsManual check used the branch
ABC-123-some-long-feature-that-needs-to-be-implementedfrom issue 16634.Screenshots / Videos
Omit the start. The ellipsis stays at the beginning:
Omit the end.
ABC-123stays visible and the ellipsis moves to the end:Omit the middle, with 12 characters kept on each side:
git-branch-ellipsis-modes.mp4
Agent Mode
CHANGELOG-IMPROVEMENT: Long git branch names in the prompt can hide the end or the middle instead of the start, and an ellipsis stays where text was removed.