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

Shell: Add builtin command to reset the internal state

The new builtin command "reset" now resets the entire internal state by
virtually destructing the Shell state and re-constructing it.

This helps for example when setting a new hostname and wanting to view
it in the current Shell program.
This commit is contained in:
Liav A 2023-08-11 13:11:15 +03:00 committed by Ali Mohammad Pur
parent 489fce0ed2
commit fb60db7b00
3 changed files with 27 additions and 3 deletions

View file

@ -54,6 +54,7 @@
__ENUMERATE_SHELL_BUILTIN(wait, InAllModes) \
__ENUMERATE_SHELL_BUILTIN(dump, InAllModes) \
__ENUMERATE_SHELL_BUILTIN(kill, InAllModes) \
__ENUMERATE_SHELL_BUILTIN(reset, InAllModes) \
__ENUMERATE_SHELL_BUILTIN(noop, InAllModes) \
__ENUMERATE_SHELL_BUILTIN(break, OnlyInPOSIXMode) \
__ENUMERATE_SHELL_BUILTIN(continue, OnlyInPOSIXMode) \
@ -414,6 +415,9 @@ private:
Shell();
virtual ~Shell() override;
void destroy();
void initialize(bool attempt_interactive);
RefPtr<AST::Node> parse(StringView, bool interactive = false, bool as_command = true) const;
void timer_event(Core::TimerEvent&) override;