Skip to content

Panic when typing long command farther than the window width and then erase line (CTRL + BS) #16183

Description

@Watynecc

Summary

Typing a long string on the command prompt that goes farther than the window width make the program panic

It seems there's also a similar issue with the file picker that i was able to also reproduce (still present on my end)

#15476

Reproduction Steps

I tried this:

  1. hx
    Then : typing a long string that goes farther than window/screen length then doing CTRL + BACKSPACE for erasing all the line

I expected this to happen: Erase the line and start typing an other command

Instead, this happened:
Program crash and show :

thread 'main' (22375) panicked at helix-term/src/ui/prompt.rs:769:55:
start byte index 30 is out of bounds for string of length 0
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

The log file isn't modified after the crash

### Platform

Linux

### Terminal Emulator

Ghostty 1.3.1-arch2.1

### Installation Method

package manager (pacman CachyOS)

### Helix Version

helix 25.07.1 (4746c276)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions