Factor some environment setting into set_scoped_internal

Breaks up a monolith function.
This commit is contained in:
ridiculousfish
2019-05-09 18:04:30 -07:00
parent 15a52d0f0d
commit ee250aba82
3 changed files with 104 additions and 93 deletions

View File

@@ -402,13 +402,12 @@ int main(int argc, char **argv) {
save_term_foreground_process_group();
}
auto &globals = env_stack_t::globals();
const struct config_paths_t paths = determine_config_directory_paths(argv[0]);
env_init(&paths);
// Set features early in case other initialization depends on them.
// Start with the ones set in the environment, then those set on the command line (so the
// command line takes precedence).
if (auto features_var = globals.get(L"fish_features")) {
if (auto features_var = env_stack_t::globals().get(L"fish_features")) {
for (const wcstring &s : features_var->as_list()) {
mutable_fish_features().set_from_string(s);
}