From 601928f49fe628abd2acd8ff77e7d5ceb5ca1c47 Mon Sep 17 00:00:00 2001 From: Indev Date: Tue, 24 Oct 2023 20:57:42 +0300 Subject: [PATCH] Only add command to history if it differs from previous one --- src/console.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/console.c b/src/console.c index 83654aaed..21c9eb695 100644 --- a/src/console.c +++ b/src/console.c @@ -1142,7 +1142,10 @@ boolean CON_Responder(event_t *ev) CONS_Printf("\x86""%c""\x80""%s\n", CON_PROMPTCHAR, inputlines[inputline]); - inputline = (inputline+1) & 31; + // Only add command to history if it differs from previous one + if (strcmp(inputlines[inputline], inputlines[(inputline-1) & 31])) + inputline = (inputline+1) & 31; + inputhist = inputline; CON_InputClear();