From 27952db9f7c235abd71041704fd7b19422c9c653 Mon Sep 17 00:00:00 2001 From: shenleban tongying Date: Fri, 13 Jan 2023 09:10:41 -0500 Subject: [PATCH] docs: clearify global vs universal variable --- doc_src/cmds/set.rst | 4 ++-- doc_src/language.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc_src/cmds/set.rst b/doc_src/cmds/set.rst index c52251d66..a16e04c74 100644 --- a/doc_src/cmds/set.rst +++ b/doc_src/cmds/set.rst @@ -51,8 +51,8 @@ The following scope control variable scope: **-g** or **--global** Sets a globally-scoped variable. - Global variables don't disappear and are available to all functions running in the same shell. - They can even be modified. + Global variables are available to all functions running in the same shell. + They can be modified or erased. These options modify how variables operate: diff --git a/doc_src/language.rst b/doc_src/language.rst index 9362680ac..b72758d69 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -944,8 +944,8 @@ Variable Scope There are four kinds of variables in fish: universal, global, function and local variables. -- Universal variables are shared between all fish sessions a user is running on one computer. -- Global variables are specific to the current fish session, and will never be erased unless explicitly requested by using ``set -e``. +- Universal variables are shared between all fish sessions a user is running on one computer. They are stored in disk and persist even after reboot. +- Global variables are specific to the current fish session. They can be erased by explicitly requesting ``set -e``. - Function variables are specific to the currently executing function. They are erased ("go out of scope") when the current function ends. Outside of a function, they don't go out of scope. - Local variables are specific to the current block of commands, and automatically erased when a specific block goes out of scope. A block of commands is a series of commands that begins with one of the commands ``for``, ``while`` , ``if``, ``function``, ``begin`` or ``switch``, and ends with the command ``end``. Outside of a block, this is the same as the function scope.