Skip to content

completion menu underlines badly with utf8 chars #17450

Closed

Description

@numero-744

Bug report form

  • I have done a basic search of the issue tracker to find any existing issues that are similar.
  • I have checked that my version is at least the latest stable release available via my installation method.

Describe the bug

The completion menu underlines the matched substring, but the underline seems shifted when there are characters on several bytes.

How to reproduce

  1. Create a file named numéro.txt
  2. Switch to substring algorithm for completion
  3. Try to complete ro
  4. o. is underlined for the numéro.txt file instead of ro
~> $env.config.completions.algorithm
substring
~| ls ro                                                       29/01/2026 09:58:03
Brouillons/         numéro.txt          .android/           .profile            
.zotero/            
Image

Expected behavior

ro should be underlined in numéro.txt

Configuration

key value
version 0.110.0
major 0
minor 110
patch 0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.93.0 (254b59607 2026-01-19)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.93.0 (083ac5135 2025-12-15)
build_time 2026-01-22 18:49:14 +01:00
build_rust_channel release
allocator standard
features default, mcp, network, plugin, rustls-tls, sqlite, trash-support
installed_plugins
experimental_options example=false, reorder-cell-paths=true, pipefail=false, enforce-runtime-annotations=false

Activity

  1. added
    status:needs-triage
    on Jan 29, 2026
  2. fdncred commented on Jan 29, 2026

    @fdncred
    Contributor

    ugh, unicode. @ysthakur thoughts?

  3. ysthakur commented on Jan 29, 2026

    @ysthakur
    Member

    Argh, I thought we'd fixed all these sorts of issues. Looks like the substring matching we do in Reedline doesn't use graphemes. Should be an easy fix.

  4. blindFS commented on Jan 30, 2026

    @blindFS
    Contributor

    Argh, I thought we'd fixed all these sorts of issues. Looks like the substring matching we do in Reedline doesn't use graphemes. Should be an easy fix.

    I wonder do we still need the substring searching in reedline once #17424 gets merged.

    Maybe only required for external completer?

  5. ysthakur commented on Jan 30, 2026

    @ysthakur
    Member

    Maybe only required for external completer?

    @blindFS Yeah, for Nushell, that's the only use case I can think of. We could always move the substring matching out of Reedline and into Nushell (and tell other Reedline consumers to also implement their own substring matching). But I don't think that would help anything

  6. blindFS commented on Jan 30, 2026

    @blindFS
    Contributor

    Maybe only required for external completer?

    @blindFS Yeah, for Nushell, that's the only use case I can think of. We could always move the substring matching out of Reedline and into Nushell (and tell other Reedline consumers to also implement their own substring matching). But I don't think that would help anything

    Good point, still worth to fix the substring matching as a fallback when indices are missing.

  7. kronberger-droid commented on Nov 16, 2026

    @kronberger-droid
    Contributor

    Since #17424 file completions send their own match positions, so on 0.117 ls ro<Tab> with the substring algorithm underlines ro in numéro.txt.
    For completers that don't send positions, nushell/reedline#1303 maps the fallback highlight to graphemes, it was merged after 0.117.

    AI:X EXECUTE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions