Skip to content

repl: add .clearhistory command#64450

Open
bitpshr wants to merge 1 commit into
nodejs:mainfrom
bitpshr:repl/add-clearhistory-command
Open

repl: add .clearhistory command#64450
bitpshr wants to merge 1 commit into
nodejs:mainfrom
bitpshr:repl/add-clearhistory-command

Conversation

@bitpshr

@bitpshr bitpshr commented Jul 12, 2026

Copy link
Copy Markdown

This pull request adds a .clearhistory REPL command that clears the current session history, both in memory and in the persistent history file when one is configured.

It clears the in-memory history array, resets the navigation index, and truncates the backing file through the open handle. Any pending debounced flush is cancelled first so it cannot rewrite the file after it has been cleared.

Fixes: #63905

Add a `.clearhistory` REPL command that clears the in-memory session
history and truncates the persisted history file when one is configured.
Any pending debounced flush is cancelled first so it cannot rewrite the
file after it has been cleared.

Fixes: nodejs#63905
Signed-off-by: Paul Bouchon <mail@bitpshr.net>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem. labels Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. repl Issues and PRs related to the REPL subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REPL: Add .clearhistory command

2 participants