mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:27:43 +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:
parent
489fce0ed2
commit
fb60db7b00
3 changed files with 27 additions and 3 deletions
|
@ -2258,9 +2258,7 @@ Shell::Shell()
|
|||
cache_path();
|
||||
}
|
||||
|
||||
Shell::Shell(Line::Editor& editor, bool attempt_interactive, bool posix_mode)
|
||||
: m_in_posix_mode(posix_mode)
|
||||
, m_editor(editor)
|
||||
void Shell::initialize(bool attempt_interactive)
|
||||
{
|
||||
uid = getuid();
|
||||
tcsetpgrp(0, getpgrp());
|
||||
|
@ -2305,11 +2303,22 @@ Shell::Shell(Line::Editor& editor, bool attempt_interactive, bool posix_mode)
|
|||
m_editor->load_history(get_history_path());
|
||||
cache_path();
|
||||
}
|
||||
}
|
||||
|
||||
Shell::Shell(Line::Editor& editor, bool attempt_interactive, bool posix_mode)
|
||||
: m_in_posix_mode(posix_mode)
|
||||
, m_editor(editor)
|
||||
{
|
||||
initialize(attempt_interactive);
|
||||
start_timer(3000);
|
||||
}
|
||||
|
||||
Shell::~Shell()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
void Shell::destroy()
|
||||
{
|
||||
if (m_default_constructed)
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue