Warning: Work in progress! Leave feedback on Zulip or Github if you'd like this doc to be updated.

Tracing Execution in Oil (xtrace)

Oil extends shell's set -x to give you more visibility into your program's execution.

Table of Contents
Background
Oil Enhancements
Useful Variables For Use in $PS4
Parsing xtrace_rich Output

Background

In shell, the $PS4 variable controls the prefix of each trace line. The default value is '+ ', which results in traces like:

+ echo 1
+ echo 2

Oil Enhancements

In Oil, the default is

PS4='${X_indent}${X_punct}${X_pid} '

To see hierarchical traces, turn on xtrace_rich:

shopt -s xtrace_rich   # part of the oil:basic option group

Useful Variables For Use in $PS4

Parsing xtrace_rich Output


Generated on Wed Jan 13 20:43:44 PST 2021