nushell / nushell/reedline

is there something like completion-prefix-display-length (~/.inputrc)?

Open
#909 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-Completions enhancement P-low
Dominant language
Rust
Stars
818
Forks
249
Avg merge
4d 14h
Merged PRs (30d)
30

Description

When you have lots of files with the same prefix is there a way to show ellipsis instead of the same long prefix on every entry when autcomplete is triggered e.g. rm this<tab>?

You can test it creating a bunch of files with 1..50 | each {touch $"this-is-a-somehow-obviously-contrived-long-prefix-($in)"}

References

See bash on the left and nushell on the right.

Image

Here the relevant configuration option for gnu's readline

#~/.inputrc

# the maximum number of characters to be the common prefix to display for
# completions. Useful when auto completing in a directory in which a lot of
# files have a long common prefix
set completion-prefix-display-length 3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining reedline's current completion display behavior and compare it with GNU Readline's completion-prefix-display-length setting in ~/.inputrc. Reproduce the issue with many files sharing the example this-is-a-somehow-obviously-contrived-long-prefix- prefix. Done means long common prefixes are shortened with an ellipsis while completions remain distinguishable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.