mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03:00
Rename $FISH_VERSION back to the original $version.
Order is restored in the universe. Fixes #4414
This commit is contained in:
@@ -866,7 +866,7 @@ The user can change the settings of `fish` by changing the values of certain var
|
||||
|
||||
- `cmd_duration`, the runtime of the last command in milliseconds.
|
||||
|
||||
- `FISH_VERSION`, the version of the currently running fish
|
||||
- `version`, the version of the currently running fish
|
||||
|
||||
- `SHLVL`, the level of nesting of shells
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@ function __fish_default_command_not_found_handler
|
||||
echo "fish: Unknown command '$argv'" >&2
|
||||
end
|
||||
|
||||
set -g version $FISH_VERSION
|
||||
|
||||
if status --is-interactive
|
||||
# The user has seemingly explicitly launched an old fish with too-new scripts installed.
|
||||
if not contains -- "string" (builtin -n)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# check if command fish_indent works and is the same version that
|
||||
# came with this fish. This will happen one time.
|
||||
command -sq fish_indent
|
||||
and command fish_indent --version 2>&1 | string match -rq $FISH_VERSION
|
||||
and command fish_indent --version 2>&1 | string match -rq $version
|
||||
# if alias doesn't define the function here, this is an autoloaded "nothing".
|
||||
# the command (if there is one) will be used by default.
|
||||
or alias fish_indent=(string escape $__fish_bin_dir/fish_indent)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# check if command fish_key_reader works and is the same version that
|
||||
# came with this fish. This will happen one time.
|
||||
command -sq fish_key_reader
|
||||
and command fish_key_reader --version 2>&1 | string match -q -- $FISH_VERSION
|
||||
and command fish_key_reader --version 2>&1 | string match -q -- $version
|
||||
# if alias doesn't define the function here, this is an autoloaded "nothing".
|
||||
# the command (if there is one) will be used by default.
|
||||
or alias fish_key_reader=(string escape $__fish_bin_dir/fish_key_reader)
|
||||
|
||||
@@ -125,7 +125,7 @@ function help --description 'Show help for the fish shell'
|
||||
end
|
||||
else
|
||||
# Go to the web. Only include one dot in the version string
|
||||
set -l version_string (echo $FISH_VERSION| cut -d . -f 1,2)
|
||||
set -l version_string (echo $version| cut -d . -f 1,2)
|
||||
set page_url https://fishshell.com/docs/$version_string/$fish_help_page
|
||||
end
|
||||
|
||||
|
||||
@@ -860,7 +860,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */) {
|
||||
wcstring(L"history"),
|
||||
wcstring(L"_"),
|
||||
wcstring(L"PWD"),
|
||||
wcstring(L"FISH_VERSION") }) {
|
||||
wcstring(L"version") }) {
|
||||
env_read_only.emplace(std::move(k));
|
||||
// L"SHLVL" is readonly but will be inserted below after we increment it.
|
||||
};
|
||||
@@ -926,7 +926,7 @@ void env_init(const struct config_paths_t *paths /* or NULL */) {
|
||||
|
||||
// Set up the version variable.
|
||||
wcstring version = str2wcstring(get_fish_version());
|
||||
env_set_one(L"FISH_VERSION", ENV_GLOBAL, version);
|
||||
env_set_one(L"version", ENV_GLOBAL, version);
|
||||
|
||||
// Set up SHLVL variable.
|
||||
const auto shlvl_var = env_get(L"SHLVL");
|
||||
|
||||
Reference in New Issue
Block a user