nushell / nushell/reedline

Cursor position after up arrow history cycling is unconventional on multi-line statements

Open
#999 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
817
Forks
247
Avg merge
4d 14h
Merged PRs (30d)
30

Description

Platform macOS Tahoe
Terminal software WezTerm, but the behavior is the same in other Terminals

Steps to reproduce

  1. Hit the up arrow to cycle to any multi-line statement in history
  2. The cursor is at the end of the first line instead of the end of the multiline command

For example:

ls█  <-cursor after hitting up
::: | where type == file

Expected behavior:

ls
::: | where type == file█  <-cursor after hitting up

Screenshots/Screencaptures

Image

Additional details

I could at least temporarily work around this issue if M-> (meta + greater than) was mapped for emacs mode, or G was mapped for vi mode to take me to the bottom, but neither is so I'm stuck arrowing around my commands.

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 reproducing the multi-line history case with the up arrow in the line editor, comparing the cursor location with the expected end-of-command position. Then trace the history-cycling and cursor-position handling, including the emacs and vi keymaps mentioned in the report; done means the cursor lands at the end of the recalled multi-line statement and the behavior is covered by a regression test.

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
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.