From f81bc8b0451aadc46ab91f8a154be42461af0443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Harald=20J=C3=B8rgensen?= <58829763+adamjoer@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:00:13 +0200 Subject: [PATCH] Shell: Add support for showing the history number in prompt with "\!" --- Userland/Shell/Shell.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index 5b74f7ff75..54f3fbedf1 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -129,6 +129,12 @@ DeprecatedString Shell::prompt() const } else if (lexer.consume_specific('p')) { builder.append(uid == 0 ? '#' : '$'); + } else if (lexer.consume_specific('!')) { + if (m_editor) + builder.appendff("{}", m_editor->history().size() + 1); + else + builder.append('!'); + } else { lexer.consume(); }