From 62ba198b40a7112be342978eade24ace3ba8f9dc Mon Sep 17 00:00:00 2001 From: rhpidfyre Date: Sat, 22 Feb 2025 21:37:05 -0500 Subject: [PATCH] fix indexing history upwards to be more accurate --- src/rt/shell/history.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rt/shell/history.ts b/src/rt/shell/history.ts index 95a383b..a1d6a5c 100644 --- a/src/rt/shell/history.ts +++ b/src/rt/shell/history.ts @@ -19,8 +19,8 @@ history.file.cursor_reset = function() { } history.add = function(cmd: string) { - if (this.file.inner[this.file.inner.length-1] !== cmd) { - this.file.inner.push(cmd) + if (this.file.inner[0] !== cmd) { + this.file.inner.unshift(cmd) } }