Skip to content

Tab completion crashes with "wopt_index is out of range" #12078

Closed

Description

@Rua

Tab completion causes Fish to crash:

$ (type part of command, press tab)
thread 'main' panicked at src/wgetopt.rs:183:9:
wopt_index is out of range
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: fish::text_face::parse_text_face_and_options
   3: fish::text_face::parse_text_face
   4: fish::highlight::highlight::HighlightColorResolver::resolve_spec_uncached::{{closure}}
   5: fish::highlight::highlight::HighlightColorResolver::resolve_spec
   6: fish::screen::Screen::write
   7: fish::reader::reader::Reader::paint_layout
   8: fish::reader::reader::Reader::handle_char_event
   9: fish::reader::reader::Reader::readline
  10: fish::reader::reader::reader_read
  11: fish::throwing_main
  12: fish::panic::panic_handler
  13: fish::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fish crashed, please report a bug. Debug PID 4772 or press Enter to exit

Fish version: 4.2.1
Terminal: Konsole 25.08.3
OS: NixOS unstable
Using NixOS' command-not-found, starship

Running sh -c 'env HOME=$(mktemp -d) XDG_CONFIG_HOME= XDG_DATA_DIRS= fish' makes the problem go away, so it may have something to do with an external component interfacing with Fish. But I don't know where the problem lies or how to find it.

Activity

  1. changed the title [-]Tab completion crashes with `wopt_index` is out of range[/-] [+]Tab completion crashes with "`wopt_index` is out of range"[/+] on Nov 18, 2025
  2. krobelus commented on Nov 18, 2025

    @krobelus
    Contributor

    it's probably crashing parsing one of your fish_color_* or fish_pager_color_* variables.
    Can you bisect those (unset as many as possible, until only the offending color variable remains).
    We'd need the value of that.

  3. Rua commented on Nov 18, 2025

    @Rua
    Author

    Yes, that was it!

    $fish_pager_color_description[1]: |yellow|
    $fish_pager_color_description[2]: |-italics|
    

    Setting it to --italics with two - fixes the crash.

  4. added this to the fish 4.3 milestone on Nov 18, 2025
  5. self-assigned this
    on Nov 18, 2025
  6. added a commit that references this issue on Nov 19, 2025
    a574ed7
  7. added a commit that references this issue on Nov 19, 2025
    c53b787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions