Is there an equivalent of POSIX shells' set -x
or set -o xtrace
that cause the shell to display the commands being run in the fish
shell?
Xtrace equivalent in the fish shell
debuggingfish
debuggingfish
Is there an equivalent of POSIX shells' set -x
or set -o xtrace
that cause the shell to display the commands being run in the fish
shell?
Best Answer
Since fish 3.1.0, the
fish_trace
variable makes this functionality available:The location of the trace output is controlled by the
--debug-output
option to the fish process.Before fish 3.1.0, you can use
fish -p some_trace_file
to run a fish session which outputs a profile to "some_trace_file", which can achieve almost the same effect (with some disadvantages - see the comments below).