diff --git a/Userland/Shell/Parser.cpp b/Userland/Shell/Parser.cpp index c821400eb1..b35ac15ac9 100644 --- a/Userland/Shell/Parser.cpp +++ b/Userland/Shell/Parser.cpp @@ -1686,7 +1686,11 @@ RefPtr Parser::parse_bareword() restore_to(rule_start->offset, rule_start->line); auto ch = consume(); VERIFY(ch == '~'); + auto username_length = username.length(); tilde = create(move(username)); + // Consume the username (if any) + for (size_t i = 0; i < username_length; ++i) + consume(); } if (string.is_empty())