#16634

Customize "git-feature-branch" terminal prompt block

Opennathan-fiscalettiopened 7d ago

Pre-submit Checks

Describe the solution you'd like?

At my company, we have long branch names. For example ABC-123-some-long-feature-that-needs-to-be-implemented.

When there is a longer branch name like this, the git-feature-branch terminal prompt block will truncate the beginning of the branch name (see screenshot.)

I'd love a way to customize this behavior. Perhaps I want the tail end to be truncated instead (so that the relevant ticket ID is still visible), or perhaps I'd like to customize HOW it's displayed (just the ticket ID).

Warp Internal (ignore) - linear-label:39cc6478-1249-4ee7-950b-c428edfeecd1

None

Activity

1
warp-for-oss[bot]7d ago

@nathan-fiscaletti

Here's what I found while triaging this issue:

Warp currently truncates long prompt chip text from the beginning, which matches the behavior shown in the screenshot. There does not appear to be an existing setting to choose a different truncation direction or custom Git branch display format.

Maintainer details

I concluded that feature request to customize how the Git branch prompt chip truncates or formats long branch names so prefixes such as ticket IDs can remain visible..

Triage summary

This is a feature request for the Git branch prompt chip: long branch names currently preserve the tail and truncate the beginning, which can hide ticket IDs or other meaningful branch prefixes.

Classification

  • Type: agent:feature
  • Area: area:shell-terminal
  • Reproducibility: high, because the current UDI chip renderer applies fixed beginning truncation for long chip text.

Likely implementation area

  • app/src/context_chips/display_chip.rs defines the UDI chip rendering path, the fixed UDI_CHIP_MAX_NUM_CHARACTERS, and the default beginning truncation call used by the Git branch chip.
  • app/src/context_chips/mod.rs defines Git branch chip display formatting such as git:(<branch>).
  • app/src/util/truncation.rs contains both beginning and end truncation helpers.
  • app/src/context_chips/display_chip_tests.rs already covers the current beginning-truncation behavior.

Duplicate check

I scanned the open issue list and recently closed issues. Related issues exist for broader prompt customization (for example rprompt/context-chip support and prompt block colors), but I did not find two or more existing issues requesting the same Git branch prompt-chip truncation/display customization, so this should not be marked as a duplicate.

This is my automated analysis and may be incorrect. A maintainer will verify the details.

Powered by Oz