1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:27:45 +00:00

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.
This commit is contained in:
Ryan Chandler 2022-02-21 21:41:25 +00:00 committed by Ali Mohammad Pur
parent 8fe20232e8
commit 05cdfb8698

View file

@ -628,7 +628,7 @@ int Shell::builtin_disown(int argc, const char** argv)
int Shell::builtin_history(int, const char**) int Shell::builtin_history(int, const char**)
{ {
for (size_t i = 0; i < m_editor->history().size(); ++i) { 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; return 0;
} }