From 05cdfb8698411726285c9c524051fcf0ed3598a0 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Mon, 21 Feb 2022 21:41:25 +0000 Subject: [PATCH] Shell: Start history counter from 1 Previously would show the list of history items starting from an index of 0. This is a bit misleading though. Running `!0` would actually cause the parser to error out and prevent you from running the command. --- Userland/Shell/Builtin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Shell/Builtin.cpp b/Userland/Shell/Builtin.cpp index da1843da85..7e0888bf5f 100644 --- a/Userland/Shell/Builtin.cpp +++ b/Userland/Shell/Builtin.cpp @@ -628,7 +628,7 @@ int Shell::builtin_disown(int argc, const char** argv) int Shell::builtin_history(int, const char**) { for (size_t i = 0; i < m_editor->history().size(); ++i) { - printf("%6zu %s\n", i, m_editor->history()[i].entry.characters()); + printf("%6zu %s\n", i + 1, m_editor->history()[i].entry.characters()); } return 0; }