You can debug a bash script like this:
bash -x script [arg1 ...]`
Question
What is the fish equivalent?
You can debug a bash script like this:
bash -x script [arg1 ...]`
What is the fish equivalent?
 
    
     
    
    Fish use a similar flag system:
fish -d 3 script.fish
Where d is the debug flag followed by the verbosity level:
-d or --debug-level=DEBUG_LEVEL specify the verbosity level of fish. A higher number means higher verbosity. The default level is 1.
 
    
     
    
    Since https://github.com/fish-shell/fish-shell/issues/3427 was merged there is now
fish_trace=on script.fish
fish_trace is just a variable, so you can set it globally or scope it locally inside functions and scripts
function im-still-debugging
   set -l fish_trace on
   ... etc
end
and turn it off with
set --erase fish_trace
as of fish 3.2, fish ignores the actual value you set, it only cares that it is set.
