1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

Shell: Do not parse history events in scripts

That makes no sense!
This commit is contained in:
AnotherTest 2021-03-05 16:14:53 +03:30 committed by Andreas Kling
parent cad7865ad1
commit a303b69caa
4 changed files with 11 additions and 9 deletions

View file

@ -562,7 +562,7 @@ int Shell::run_command(const StringView& cmd, Optional<SourcePosition> source_po
if (cmd.is_empty())
return 0;
auto command = Parser(cmd).parse();
auto command = Parser(cmd, m_is_interactive).parse();
if (!command)
return 0;
@ -1289,7 +1289,7 @@ void Shell::add_entry_to_cache(const String& entry)
void Shell::highlight(Line::Editor& editor) const
{
auto line = editor.line();
Parser parser(line);
Parser parser(line, m_is_interactive);
auto ast = parser.parse();
if (!ast)
return;
@ -1300,7 +1300,7 @@ Vector<Line::CompletionSuggestion> Shell::complete()
{
auto line = m_editor->line(m_editor->cursor());
Parser parser(line);
Parser parser(line, m_is_interactive);
auto ast = parser.parse();
@ -1562,7 +1562,7 @@ bool Shell::has_history_event(StringView source)
bool has_history_event { false };
} visitor;
Parser { source }.parse()->visit(visitor);
Parser { source, true }.parse()->visit(visitor);
return visitor.has_history_event;
}