Add command to history when entered, instead of when command exits
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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