Dedup command history by default (#17852)

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 
This commit is contained in:
Leonard Hecker 2024-09-04 21:57:23 +02:00 committed by GitHub
parent 7b50f12a78
commit 5fdfd51209
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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),
@ -110,7 +110,7 @@ void Settings::ApplyDesktopSpecificDefaults()
_bQuickEdit = TRUE;
_uHistoryBufferSize = 50;
_uNumberOfHistoryBuffers = 4;
_bHistoryNoDup = FALSE;
_bHistoryNoDup = true;
_renderSettings.ResetColorTable();

View File

@ -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)