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

Closed
opened 2026-01-31 08:14:54 +00:00 by claunia · 4 comments
Owner

Originally created by @dbc60 on GitHub (Nov 2, 2024).

Originally assigned to: @lhecker on GitHub.

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.

Originally created by @dbc60 on GitHub (Nov 2, 2024). Originally assigned to: @lhecker on GitHub. ### 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.
Author
Owner

@ikkierie commented on GitHub (Nov 5, 2024):

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

@ikkierie commented on GitHub (Nov 5, 2024): As a temporary measure, downgrading to release v1.21.2361.0 or lower rolls back this change.
Author
Owner

@dbc60 commented on GitHub (Nov 5, 2024):

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.

@dbc60 commented on GitHub (Nov 5, 2024): 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.
Author
Owner

@lhecker commented on GitHub (Nov 21, 2024):

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.

@lhecker commented on GitHub (Nov 21, 2024): 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.
Author
Owner

@ikkierie commented on GitHub (Nov 21, 2024):

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)

@ikkierie commented on GitHub (Nov 21, 2024): 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)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22487