nushell / nushell/nushell

config: add option to put canceled commands in history (like zsh)

Open
#9,503 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A:history A:line-editor
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 19h
Merged PRs (30d)
85

Description

Describe the bug

Hi,

I have this slightly annoying issue where I'll accidentally type something like this:

echo "foo"'

Note the trailing single-quote.

Now, I normally panic, hit ctrl-c and then tap "up" to edit the command.

However, nu doesn't seem to add these canceled commands into the history.

ZSH does, which is why I have this muscle memory. For now, I have to take to using the touchpad to select the text, copy paste and then fix it.

How to reproduce
  1. Typo
  2. Cancel
  3. Try to fix.
Expected behavior

I expected nu to put the abandonded entry into history so that I can access it easily and fix it.

Screenshots

No response

Configuration
key value
version 0.81.1
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
allocator standard
features default, sqlite, trash, which, 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 how canceled interactive commands are handled and where command history entries are recorded. Define the configuration option so an abandoned input can be recalled and edited, then verify the behavior using the reproduction steps: enter malformed input, cancel it, and retrieve it with the up key.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.