5

The new PowerShell has a default irritating feature of keeping duplicate commands in the keyboard buffer. For example, if I had executed the command DIR ten times, pushing the Up Arrow will show ten DIR entries.

I tried to check the Discard Old Duplicates box in Properties/Options, but this did not work.

How do I turn off duplicate commands?

0

1 Answer 1

6

PowerShell in Windows 10 use PSReadline for better command line editing experience. PSReadline does not use normal console input buffer and so not affected by Discard Old Duplicates option. You should disable duplicates in PSReadline options:

Set-PSReadlineOption -HistoryNoDuplicates

You have to put that in your PowerShell profile, if you want this as default behavior.

1
  • Thanks. This has been annoying me for some time -- but just got around to looking up how to take care of it.
    – David Culp
    Commented Sep 19, 2016 at 2:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .