mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
Shell: Treat builtin names as programs and suggest them
This commit is contained in:
parent
87cb28fcf7
commit
1469d20e63
Notes:
sideshowbarker
2024-07-19 06:34:00 +09:00
Author: https://github.com/alimpfard
Commit: 1469d20e63
Pull-request: https://github.com/SerenityOS/serenity/pull/2260
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
2 changed files with 12 additions and 0 deletions
|
@ -1373,6 +1373,10 @@ void Shell::cache_path()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add shell builtins to the cache
|
||||||
|
for (const auto& builtin_name : builtin_names)
|
||||||
|
cached_path.append(escape_token(builtin_name));
|
||||||
|
|
||||||
quick_sort(cached_path);
|
quick_sort(cached_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,6 +174,14 @@ private:
|
||||||
|
|
||||||
#undef __ENUMERATE_SHELL_BUILTIN
|
#undef __ENUMERATE_SHELL_BUILTIN
|
||||||
|
|
||||||
|
constexpr static const char* builtin_names[] = {
|
||||||
|
#define __ENUMERATE_SHELL_BUILTIN(builtin) #builtin,
|
||||||
|
|
||||||
|
ENUMERATE_SHELL_BUILTINS()
|
||||||
|
|
||||||
|
#undef __ENUMERATE_SHELL_BUILTIN
|
||||||
|
};
|
||||||
|
|
||||||
ExitCodeOrContinuationRequest::ContinuationRequest m_should_continue { ExitCodeOrContinuationRequest::Nothing };
|
ExitCodeOrContinuationRequest::ContinuationRequest m_should_continue { ExitCodeOrContinuationRequest::Nothing };
|
||||||
StringBuilder m_complete_line_builder;
|
StringBuilder m_complete_line_builder;
|
||||||
bool m_should_break_current_command { false };
|
bool m_should_break_current_command { false };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue