mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 05:52:53 +00:00
Shell: Evaluate the program name before parsing arguments
Otherwise, we are too late to catch the "load the POSIX-compatible shellrc" branch.
This commit is contained in:
parent
0a63e543b7
commit
b1739029ef
Notes:
sideshowbarker
2024-07-17 00:47:29 +09:00
Author: https://github.com/timschumi
Commit: b1739029ef
Pull-request: https://github.com/SerenityOS/serenity/pull/18012
Reviewed-by: https://github.com/alimpfard
1 changed files with 2 additions and 2 deletions
|
@ -60,7 +60,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
editor = Line::Editor::construct(move(configuration));
|
||||
editor->initialize();
|
||||
|
||||
shell = Shell::Shell::construct(*editor, attempt_interactive, posix_mode || LexicalPath::basename(arguments.strings[0]) == "sh"sv);
|
||||
shell = Shell::Shell::construct(*editor, attempt_interactive, posix_mode);
|
||||
s_shell = shell.ptr();
|
||||
|
||||
s_shell->setup_signals();
|
||||
|
@ -171,7 +171,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
StringView format;
|
||||
bool should_format_live = false;
|
||||
bool keep_open = false;
|
||||
bool posix_mode = false;
|
||||
bool posix_mode = (LexicalPath::basename(arguments.strings[0]) == "sh"sv);
|
||||
|
||||
Core::ArgsParser parser;
|
||||
parser.add_option(command_to_run, "String to read commands from", "command-string", 'c', "command-string");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue