mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 04:41:14 -03:00
Only set default fish_function_path when --no-config is used
Otherwise config.fish will keep $fish_function_path.
This commit is contained in:
10
src/env.cpp
10
src/env.cpp
@@ -246,7 +246,7 @@ static void setup_path() {
|
||||
}
|
||||
}
|
||||
|
||||
void env_init(const struct config_paths_t *paths, bool do_uvars) {
|
||||
void env_init(const struct config_paths_t *paths, bool do_uvars, bool default_paths) {
|
||||
env_stack_t &vars = env_stack_t::principal();
|
||||
// Import environment variables. Walk backwards so that the first one out of any duplicates wins
|
||||
// (See issue #2784).
|
||||
@@ -282,9 +282,11 @@ void env_init(const struct config_paths_t *paths, bool do_uvars) {
|
||||
vars.set_one(FISH_SYSCONFDIR_VAR, ENV_GLOBAL, paths->sysconf);
|
||||
vars.set_one(FISH_HELPDIR_VAR, ENV_GLOBAL, paths->doc);
|
||||
vars.set_one(FISH_BIN_DIR, ENV_GLOBAL, paths->bin);
|
||||
wcstring scstr = paths->data;
|
||||
scstr.append(L"/functions");
|
||||
vars.set_one(L"fish_function_path", ENV_GLOBAL, scstr);
|
||||
if (default_paths) {
|
||||
wcstring scstr = paths->data;
|
||||
scstr.append(L"/functions");
|
||||
vars.set_one(L"fish_function_path", ENV_GLOBAL, scstr);
|
||||
}
|
||||
}
|
||||
|
||||
// Some `su`s keep $USER when changing to root.
|
||||
|
||||
Reference in New Issue
Block a user