Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stanio opened this issue Jul 15, 2022 · 8 comments
Open

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

stanio opened this issue Jul 15, 2022 · 8 comments
Labels
Area-CookedRead The cmd.exe COOKED_READ handling Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Conhost For issues in the Console codebase
Milestone

Comments

@stanio
Copy link

stanio commented Jul 15, 2022

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

  • 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

Actual Behavior

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

wterm-console-buffer

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

@stanio stanio added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Jul 15, 2022
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jul 15, 2022
@stanio
Copy link
Author

stanio commented Jul 15, 2022

FWIW, I'm not sure this is a Windows Terminal issue, as I'm noticing every time I open the (legacy) "Console Windows Properties" I'm seeing the "Discard Old Duplicates" setting unchecked while I'm seeing "HistoryNoDup"=dword:00000001 in the Windows Registry:

windows-registry

I'm observing this UI(?) quirk on at least two Windows 10 machines.

@stanio
Copy link
Author

stanio commented Jul 16, 2022

More details – if I repeat just the same last command, it doesn't get multiplied to the end of the command history:

>dir
>dir /b
>dir
>dir
>dir

F7 (doskey /?):

┌────────────────────────────────────────┐
│0: dir                                  │
│1: dir /b                               │
│2: dir                                  │
│                                        │
│                                        │
│                                        │
│                                        │
│                                        │
│                                        │
│                                        │
└────────────────────────────────────────┘

So it is likely a half-baked port of the original "Discard Old Duplicates" implementation.

My workflow involves repeating 2-3 commands (build, deploy, cls) for some time. After that, I want to quickly select and execute some other command(s) I've executed previously. The current behavior breaks it for me.

@zadjii-msft
Copy link
Member

This is probably another face of #2558. When run in ConPTY (read: the terminal), the console just ignores most settings. That might have been a mis-play. We may want to keep around the history settings, but just ignore the "appearance" ones.

Ultimately, this has the same root cause as that issue, so I'm gonna close it as a dupe for bookkeeping purposes. Thanks!

/dup #2558

@zadjii-msft zadjii-msft closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2022
@ghost

This comment was marked as outdated.

@ghost ghost closed this as completed Jul 19, 2022
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 19, 2022
@stanio
Copy link
Author

stanio commented Jul 19, 2022

Just want to clarify my problem is not that the Windows Terminal doesn't appear to obey the "Discard Old Duplicates" option. It appears to implement some form of it – "discards" just the last command if it matches the previous one. It might be doing it by default, not obeying the original setting (haven't verified explicitly) but this issue is about not matching the original "Discard Old Duplicates" behavior. I suspect even if the setting is read from the Console, the Terminal behavior might still be left broken (at least for me).

@DHowett
Copy link
Member

DHowett commented Jul 19, 2022

Yeah, I think this one is worth tracking. Even in its default configuration (read: enabled) it doesn't do what it says on the tin.

@DHowett DHowett reopened this Jul 19, 2022
@ghost

This comment was marked as outdated.

@ghost ghost closed this as completed Jul 20, 2022
@DHowett

This comment was marked as off-topic.

@DHowett DHowett added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting and removed Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. labels Jul 20, 2022
@DHowett DHowett reopened this Jul 20, 2022
@zadjii-msft zadjii-msft added Product-Conhost For issues in the Console codebase Help Wanted We encourage anyone to jump in on these. Priority-2 A description (P2) Area-CookedRead The cmd.exe COOKED_READ handling labels Jul 26, 2022
@zadjii-msft zadjii-msft added this to the Backlog milestone Jul 26, 2022
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jul 26, 2022
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CookedRead The cmd.exe COOKED_READ handling Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-2 A description (P2) Product-Conhost For issues in the Console codebase
Projects
None yet
Development

No branches or pull requests

3 participants