mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 01:01:12 -03:00
Fix $SHLVL
Due to being read-only, SHLVL wasn't being incremented properly for recursive invocations of fish.
This commit is contained in:
3
env.cpp
3
env.cpp
@@ -443,7 +443,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */)
|
||||
L"LINES",
|
||||
L"COLUMNS",
|
||||
L"PWD",
|
||||
L"SHLVL",
|
||||
//L"SHLVL", // will be inserted a bit lower down
|
||||
L"FISH_VERSION",
|
||||
};
|
||||
for (size_t i=0; i < sizeof ro_keys / sizeof *ro_keys; i++)
|
||||
@@ -549,6 +549,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */)
|
||||
}
|
||||
}
|
||||
env_set(L"SHLVL", nshlvl_str.c_str(), ENV_GLOBAL | ENV_EXPORT);
|
||||
env_read_only.insert(L"SHLVL");
|
||||
|
||||
/* Set up the HOME variable */
|
||||
if (env_get_string(L"HOME").missing_or_empty())
|
||||
|
||||
Reference in New Issue
Block a user