Skip to content

Bash vi history search redraws the prompt incorrectly after the prompt length increases. #2252

Description

@ocmstone

Is this a reproducible bug?

  • I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
  • I reproduced this bug on the version and environment reported below using the exact steps provided.

Current behavior

With set -o vi enabled, after changing into a directory that makes PS1 longer (/w), pressing Esc then / to perform a history search redraws the prompt incorrectly. The prompt is truncated, and the search text begins at the wrong position. Pressing Ctrl-L immediately redraws the prompt correctly.

Expected behavior

The full current prompt is displayed and the search text appears immediately after it.

Reproduction

Start Herdr while in $HOME.

Run:

bash --noprofile --norc
set -o vi
PS1='\u@\h:\w$ '
cd into a directory with a much longer path.
Press Esc, then /.
Begin typing a history search.

Impact

The prompt is corrupted and matches render illegibly at the right side of the screen.

Environment

  • Herdr version: 0.7.5
  • Update channel (stable or preview): stable
  • Operating system: macOS Tahoe 26.6
  • Terminal: Terminal.app (Apple)
  • Shell, if relevant: bash 5.3.15
  • Relevant config, if any: set -o vi

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainer-neededrequires maintainer judgment or maintainer-only reproduction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions