mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
Shell: Add support for showing the history number in prompt with "\!"
This commit is contained in:
parent
f597d7c730
commit
f81bc8b045
1 changed files with 6 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue