nushell / nushell/nu_scripts

fuzzy-history menu is blatantly incorrect

Open
#1,131 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Nushell
Stars
1.3k
Forks
323
Avg merge
3h 34m
Merged PRs (30d)
4

Description

The following is used for a fuzzy completion menu:

  {
    name: fuzzy_history
    modifier: control
    keycode: char_h
    mode: [emacs, vi_normal, vi_insert]
    event: {
      send: executehostcommand
      cmd: "commandline (
        history
        | par-each { |it| $it.command }
        | uniq
        |  reverse
        | input list --fuzzy
          $'Please choose a (ansi magenta)command for history(ansi reset):'
      )"
    }
  }

However you cannot give commandline a positional argument:

~> Error: nu::parser::extra_positional                                                                                                                                                                                                                       06/09/2025 07:42:57 PM

  × Extra positional argument.
   ╭─[entry #27:1:13]
 1 │ ╭─▶ commandline (
 2 │ │           history
 3 │ │           | par-each { |it| $it.command }
 4 │ │           | uniq
 5 │ │           |  reverse
 6 │ │           | input list --fuzzy
 7 │ │             $'Please choose a (ansi magenta)command for history(ansi reset):'
 8 │ ├─▶       )
   · ╰──── extra positional argument
   ╰────
  help: Usage: commandline

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 with the fuzzy_history configuration shown in the issue and reproduce the commandline parser error. Confirm the intended fuzzy history menu behavior, then verify that the configuration no longer reports an extra positional argument and still allows choosing a history command.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.