Skip to content

Do not save consecutive duplicate commands to history#1120

Merged
tompng merged 2 commits into
ruby:masterfrom
topalovic:history_ignoredups
Oct 30, 2025
Merged

Do not save consecutive duplicate commands to history#1120
tompng merged 2 commits into
ruby:masterfrom
topalovic:history_ignoredups

Conversation

@topalovic
Copy link
Copy Markdown
Contributor

@topalovic topalovic commented Sep 6, 2025

Emulates HISTCONTROL=ignoredups from Bash and partly addresses #355.

IRB will not add a command to history if it's the same as the immediate previous command; it won't look further back in the history list. This is also the default behavior in Pry.

It might be safer to expose this as a config flag but personally I don't see the value in consecutive duplicate entries. Open to discussion, of course!

Copy link
Copy Markdown
Member

@tompng tompng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tompng tompng merged commit c7e3227 into ruby:master Oct 30, 2025
33 checks passed
@tompng tompng added the enhancement New feature or request label Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants