How can I print executed commands in fish shell?
I've tried solutions from In a shell script: echo shell commands as they are executed, but they are not compatible with fish shell.
Starting from fish-3.1.0, $fish_trace
can be set to enable output similar to Bash’s set -x
.
For example,
set fish_trace 1
before commands that should be traced.