Skip to content

Commit

Permalink
Dedup command history by default (#17852)
Browse files Browse the repository at this point in the history
Under ConPTY we don't load any user settings. `SetUpConsole` notes:
> If we are [ConPTY], we don't want to load any user settings,
> because that could result in some strange rendering results [...]

This enables deduplication by default, which I figured wouldn't cause
any regressions since it's a user-controllable setting anyway, while
it's clearly something the average user wants enabled, for the same
reason that PSReadLine has HistoryNoDuplicates enabled by default.

Closes #17797

## Validation Steps Performed
* Launch conhost, enter 2 commands, press F7, select the older one,
  press Enter, press F7. 2 entries ✅
* Launch WT, enter 2 commands, press F7, select the older one,
  press Enter, press F7. 2 entries ✅

(cherry picked from commit 5fdfd51)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgSN1FQ
Service-Version: 1.22
  • Loading branch information
lhecker authored and DHowett committed Sep 4, 2024
1 parent be99f93 commit 03fc325
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/host/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Settings::Settings() :
_bAutoPosition(true),
_uHistoryBufferSize(DEFAULT_NUMBER_OF_COMMANDS),
_uNumberOfHistoryBuffers(DEFAULT_NUMBER_OF_BUFFERS),
_bHistoryNoDup(false),
_bHistoryNoDup(true),
// ColorTable initialized below
_uCodePage(ServiceLocator::LocateGlobals().uiOEMCP),
_uScrollScale(1),
Expand Down Expand Up @@ -110,7 +110,7 @@ void Settings::ApplyDesktopSpecificDefaults()
_bQuickEdit = TRUE;
_uHistoryBufferSize = 50;
_uNumberOfHistoryBuffers = 4;
_bHistoryNoDup = FALSE;
_bHistoryNoDup = true;

_renderSettings.ResetColorTable();

Expand Down
2 changes: 1 addition & 1 deletion src/propsheet/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ VOID InitRegistryValues(
pStateInfo->CursorSize = 25;
pStateInfo->HistoryBufferSize = 25;
pStateInfo->NumberOfHistoryBuffers = 4;
pStateInfo->HistoryNoDup = 0;
pStateInfo->HistoryNoDup = 1;

// clang-format off
if (pStateInfo->fIsV2Console)
Expand Down

0 comments on commit 03fc325

Please sign in to comment.