nushell / nushell/reedline

"Until" keybinding with send empty menu should trigger next action

Open
#603 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

line editor
Dominant language
Rust
Stars
818
Forks
249
Avg merge
4d 14h
Merged PRs (30d)
30

Description

Describe the bug

I tried to stack completion_menu and historynextcomplete in until keybinding.

        until: [
          { send: menu name: completion_menu }
          { send: historyhintwordcomplete }
          { send: menunext }
          { edit: complete }
        ]

Unfortunately, send: menu action doesn't know when the activated menu has no entry. Instead of return as failed, it shows it anyway. In turn, the historynextcomplete doesn't get called that often.

How to reproduce
  1. Modify tab keybinding to look as follow (mainly until stack):
    ...
    {
      name: completion_menu
      modifier: none
      keycode: tab
      mode: [emacs vi_normal vi_insert]
      event: {
        until: [
          { send: menu name: completion_menu }
          { send: historyhintwordcomplete }
          { send: menunext }
          { edit: complete }
        ]
      }
    }
    
  2. Type something with possible hint: cd ~
  3. Press tab
Expected behavior

The shell instead choose to complete the hint.

Screenshots
  1. Type something with possible hint
    Screenshot from 2023-07-15 03-02-04
  2. Press tab
    Screenshot from 2023-07-15 03-02-10
Configuration

$ version | transpose key value | to md --pretty

key value
version 0.80.0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.69.0 (84c898d65 2023-04-16) (built from a source tarball)
cargo_version cargo 1.69.0
build_time 1980-01-01 00:00:00 +00:00
build_rust_channel release
features default, zip
installed_plugins
Additional context

No response

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 tracing the keybinding handling for the until stack and the send: menu name: completion_menu action. Reproduce the configuration with cd ~ and Tab, then verify that an empty menu action fails so the next history completion action runs.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.