docs/language: Some small bits

This commit is contained in:
Fabian Boehm 2022-12-30 13:52:55 +01:00
parent 3bacbeb2e1
commit d14f39e583

View file

@ -1273,7 +1273,7 @@ For more information on argparse, like how to handle option arguments, see :doc:
PATH variables
^^^^^^^^^^^^^^
Path variables are a special kind of variable used to support colon-delimited path lists including :envvar:`PATH`, :envvar:`CDPATH`, :envvar:`MANPATH`, :envvar:`PYTHONPATH`, etc. All variables that end in "PATH" (case-sensitive) become PATH variables.
Path variables are a special kind of variable used to support colon-delimited path lists including :envvar:`PATH`, :envvar:`CDPATH`, :envvar:`MANPATH`, :envvar:`PYTHONPATH`, etc. All variables that end in "PATH" (case-sensitive) become PATH variables by default.
PATH variables act as normal lists, except they are implicitly joined and split on colons.
@ -1309,20 +1309,12 @@ You can change the settings of fish by changing the values of certain variables.
.. envvar:: PATH
A list of directories in which to search for commands.
A list of directories in which to search for commands. This is a common unix variable also used by other tools.
.. envvar:: CDPATH
A list of directories in which the :doc:`cd <cmds/cd>` builtin looks for a new directory.
.. envvar:: FISH_DEBUG
Controls which debug categories :command:`fish` enables for output, analogous to the ``--debug`` option.
.. envvar:: FISH_DEBUG_OUTPUT
Specifies a file to direct debug output to.
.. describe:: Locale Variables
The locale variables :envvar:`LANG`, :envvar:`LC_ALL`, :envvar:`LC_COLLATE`, :envvar:`LC_CTYPE`, :envvar:`LC_MESSAGES`, :envvar:`LC_MONETARY`, :envvar:`LC_NUMERIC`, and :envvar:`LANG` set the language option for the shell and subprograms. See the section :ref:`Locale variables <variables-locale>` for more information.
@ -1380,6 +1372,14 @@ You can change the settings of fish by changing the values of certain variables.
if set and not empty, will cause fish to print commands before they execute, similar to ``set -x``
in bash. The trace is printed to the path given by the `--debug-output` option to fish or the :envvar:`FISH_DEBUG_OUTPUT` variable. It goes to stderr by default.
.. envvar:: FISH_DEBUG
Controls which debug categories :command:`fish` enables for output, analogous to the ``--debug`` option.
.. envvar:: FISH_DEBUG_OUTPUT
Specifies a file to direct debug output to.
.. envvar:: fish_user_paths
a list of directories that are prepended to :envvar:`PATH`. This can be a universal variable.
@ -1850,4 +1850,6 @@ Fish includes basic built-in debugging facilities that allow you to stop executi
To start a debug session simply insert the :doc:`builtin command <cmds/breakpoint>` ``breakpoint`` at the point in a function or script where you wish to gain control, then run the function or script. Also, the default action of the ``TRAP`` signal is to call this builtin, meaning a running script can be actively debugged by sending it the ``TRAP`` signal (``kill -s TRAP <PID>``). There is limited support for interactively setting or modifying breakpoints from this debug prompt: it is possible to insert new breakpoints in (or remove old ones from) other functions by using the ``funced`` function to edit the definition of a function, but it is not possible to add or remove a breakpoint from the function/script currently loaded and being executed.
Another way to debug script issues is to set the :envvar:`fish_trace` variable, e.g. ``fish_trace=1 fish_prompt`` to see which commands fish executes when running the :doc:`fish_prompt <cmds/fish_prompt>` function.
If you specifically want to debug performance issues, :program:`fish` can be run with the ``--profile /path/to/profile.log`` option to save a profile to the specified path. This profile log includes a breakdown of how long each step in the execution took. See :doc:`fish <cmds/fish>` for more information.