summaryrefslogtreecommitdiff
path: root/Userland/Shell
diff options
context:
space:
mode:
authorRyan Chandler <ryangjchandler@gmail.com>2022-02-21 21:41:25 +0000
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-02-22 21:26:25 +0330
commit05cdfb8698411726285c9c524051fcf0ed3598a0 (patch)
treed99f2e7d84ed85ebe881bb3243bed0122ab6ac20 /Userland/Shell
parent8fe20232e8506eda3fed3fd1e5360884d1280777 (diff)
downloadserenity-05cdfb8698411726285c9c524051fcf0ed3598a0.zip
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.
Diffstat (limited to 'Userland/Shell')
-rw-r--r--Userland/Shell/Builtin.cpp2
1 files changed, 1 insertions, 1 deletions
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;
}