microsoft / microsoft/terminal

Console "Discard Old Duplicates" doesn't apply in Windows Terminal

Open
#13,515 11 comments 3 reactions 0 assignees View on GitHub
Area-CookedRead Help Wanted Issue-Bug Needs-Tag-Fix Priority-2 Product-Conhost
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

1.14.1861.0

### Windows build number

10.0.19043.1826

### Other Software

_No response_

### Steps to reproduce

- Open a legacy "Command Prompt" console;
- From the window menu (top-right icon) select "Defaults";
- Check "Discard Old Duplicates" in the "Command History" options group, and "OK" to apply;

![console-properties](https://user-images.githubusercontent.com/1247730/179306109-608d22dc-f1f8-45fe-8c94-adc8183ec78b.png)

- Open a "Command Prompt" in Windows Terminal, and enter commands in succession:
```
dir
dir /b
dir
dir /b
dir
dir /b
```

### Expected Behavior

The command buffer should discard previous duplicate entries, as I'm seeing in a legacy "Command Prompt" console – pressing F7 reveals:

![legacy-console-buffer](https://user-images.githubusercontent.com/1247730/179306239-3644108c-0fe8-4246-8fb5-3f3ca17d9861.png)

### Actual Behavior

The "Command Prompt" in Windows Terminal doesn't appear to honor the "Discard Old Duplicates" setting – pressing F7 reveals:

![wterm-console-buffer](https://user-images.githubusercontent.com/1247730/179306911-58b46cec-c448-4ddb-9f65-501d45639ceb.png)

This often causes the inconvenience of losing previous command history, after repeating a few of the same commands in succession for some time.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with Windows Terminal 1.14.1861.0 using the listed Command Prompt history setting and command sequence, then compare the F7 history with a legacy console. Trace the command-history handling to determine why "Discard Old Duplicates" is not honored, and verify that repeated commands are removed without losing earlier history.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.