From 5506932788a27059572ae006648c3b3ff6866910 Mon Sep 17 00:00:00 2001 From: Humberto Alves Date: Sun, 3 Apr 2022 22:07:40 +0100 Subject: [PATCH] Shell: Refresh PATH cache after running shellrc files This fixes the highlight of runnable commands, whenever PATH variable is changed in one of the shellrc files. --- Userland/Shell/Shell.h | 2 +- Userland/Shell/main.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Shell/Shell.h b/Userland/Shell/Shell.h index 31d3066c108..322043c400b 100644 --- a/Userland/Shell/Shell.h +++ b/Userland/Shell/Shell.h @@ -241,6 +241,7 @@ public: String get_history_path(); void print_path(StringView path); + void cache_path(); bool read_single_line(); @@ -343,7 +344,6 @@ private: void bring_cursor_to_beginning_of_a_line() const; Optional resolve_job_spec(StringView); - void cache_path(); void add_entry_to_cache(String const&); void remove_entry_from_cache(StringView); void stop_all_jobs(); diff --git a/Userland/Shell/main.cpp b/Userland/Shell/main.cpp index ae02376d810..ffff343fedc 100644 --- a/Userland/Shell/main.cpp +++ b/Userland/Shell/main.cpp @@ -225,6 +225,7 @@ ErrorOr serenity_main(Main::Arguments arguments) }; run_rc_file(Shell::Shell::global_init_file_path); run_rc_file(Shell::Shell::local_init_file_path); + shell->cache_path(); } {