Skip to content

Commit 52ba345

Browse files
committed
Don't add empty lines to history
1 parent d3ef249 commit 52ba345

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PSReadLine/ReadLine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ void ProcessOneKey(ConsoleKeyInfo key, Dictionary<ConsoleKeyInfo, KeyHandler> di
345345

346346
private string MaybeAddToHistory(string result)
347347
{
348-
bool addToHistory = (_addToHistoryHandler == null) || _addToHistoryHandler(result);
348+
bool addToHistory = !string.IsNullOrWhiteSpace(result) && ((_addToHistoryHandler == null) || _addToHistoryHandler(result));
349349
if (addToHistory && _historyNoDuplicates)
350350
{
351351
// REVIEW: should history be case sensitive - it is now.

0 commit comments

Comments
 (0)