From 5a0303d649d57d6b27baaf8a48188badd67b1fa8 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 eb6e1c40f..f7610c9fe 100644 --- a/src/console.c +++ b/src/console.c @@ -1277,7 +1277,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();