Skip to content

Can't cycle through command history using the down-arrow #18138

Closed

Description

Windows Terminal version

1.21.2911.0

Windows build number

10.0.22631.4391

Other Software

No response

Steps to reproduce

I used to be able to run

> echo 1
1
> echo 2
2
> echo 3
3

and then press UP ARROW three times to repeat echo 1 and then DOWN ARROW to cycle through echo 2, echo 3, echo 1, etc. Now the first DOWN ARROW does nothing.

I think both Command Prompt and PowerShell had this behavior. I do know I used that pattern of cycling through the history for Command Prompt quite frequently, but now I find that I must press UP ARROW three times each time I want to cycle through the last three commands. It would be nice to have the old behavior back.

I haven't found any documentation or bug reports that addresses this issue. Thanks in advance for your help.

Expected Behavior

After pressing UP ARROW three times and ENTER to execute the third command back in history, I expected pressing DOWN ARROW followed by ENTER to execute each of the past 3 commands in sequence ad infinitum.

Actual Behavior

After pressing UP ARROW three times and ENTER to execute the third command back in history, pressing DOWN ARROW does nothing. No previous command is recalled from history.

Activity

  1. added
    Issue-Bug
    Needs-Triage
    on Nov 2, 2024
  2. added
    Product-Conhost
    Priority-3
    Area-CookedRead
    and removed
    Needs-Triage
    on Nov 4, 2024
  3. moved this from To Cherry Pick to To Consider in 1.22 Servicing Pipelineon Nov 4, 2024
  4. moved this from To Cherry Pick to To Consider in 1.21 Servicing Pipelineon Nov 4, 2024
  5. removed
    Needs-Tag-Fix
    on Nov 4, 2024
  6. ikkierie commented on Nov 5, 2024

    @ikkierie

    As a temporary measure, downgrading to release v1.21.2361.0 or lower rolls back this change.

  7. dbc60 commented on Nov 5, 2024

    @dbc60
    Author

    Thank you. I rolled back to v1.21.2361.0 (which works well enough and resolves this issue for the time being) and look forward to the release of v1.23.

  8. lhecker commented on Nov 21, 2024

    @lhecker
    Member

    Apparently that's how cmd has always worked if "Discard old duplicates" is enabled, huh. I wonder if I should double-down by changing the "Discard old duplicates" behavior and add the "circling" that you describe, or if I should revert enabling it by default under Windows Terminal.

  9. ikkierie commented on Nov 21, 2024

    @ikkierie

    i think a problem here is that the "replay" behaviour working consistently is dependent on not deleting old duplicate commands, since if you delete an old duplicate, you change the command sequence

    i.e. with dedup

    cls
    echo 1
    echo 2
    echo 3
    ...
    echo 2
    

    means that "replaying" from cls onwards would then run

    cls
    echo 1
    echo 3
    

    i think that, if there can't be configuration on the user end, not having dedup is the better option since the only downside (afaik) is that it's inefficient usage of the history buffer (and to my knowledge that shoudn't be an issue if the history buffer is set to any reasonable size)

  10. added
    In-PR
    on Nov 21, 2024
  11. added a commit that references this issue on Nov 26, 2024
    220c7cd
  12. moved this from To Consider to To Cherry Pick in 1.22 Servicing Pipelineon Feb 3, 2025
  13. moved this from To Cherry Pick to Cherry Picked in 1.22 Servicing Pipelineon Feb 3, 2025
  14. added a commit that references this issue on Feb 3, 2025
    938b219
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area-CookedReadIn-PRIssue-BugNeeds-Tag-FixPriority-3Product-Conhost

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions