nushell / nushell/nushell

Add command to history when entered, instead of when command exits

Open
#7,855 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

category:enhancement
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 19h
Merged PRs (30d)
85

Description

Related problem

Some commands may not exit for a long time, like ssh, or may be exited without returning to the shell, such as by killing the window. In these situations, the command will not be added to history for a long time, if at all.

Describe the solution you'd like

Instead of waiting for a command to exit before recording it to history, Nushell should save commands to history when the enter key is pressed.

Describe alternatives you've considered

No response

Additional context and details

P.S. the sync_on_enter setting is misleading because Nushell does not sync history on enter.

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 Nushell's command-entry path and the history-recording implementation to find where commands are currently saved after exit. Check how the sync_on_enter setting is handled and identify existing history tests. Done means commands are persisted when Enter is pressed, including commands that remain running or terminate with the shell window.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.