Skip to content

Commit

Permalink
Shell: Start history counter from 1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ryangjchandler authored and alimpfard committed Feb 22, 2022
1 parent 8fe2023 commit 05cdfb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Userland/Shell/Builtin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 05cdfb8

Please sign in to comment.