Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
a authored and jnoortheen committed Apr 26, 2024
1 parent 52c96c9 commit a769689
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions xonsh/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,7 @@ class GeneralSetting(Xettings):
)
XONSH_TRACE_SUBPROC = Var(
default=always_false,
convert=to_bool_or_int,
doc="Set to ``True`` or ``1`` to show arguments list of every executed subprocess command. "
"Use ``2`` to have full specification.",
)
Expand Down
4 changes: 2 additions & 2 deletions xonsh/procs/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,14 +887,14 @@ def run_subproc(cmds, captured=False, envs=None):

specs = cmds_to_specs(cmds, captured=captured, envs=envs)

if trace := XSH.env.get("XONSH_TRACE_SUBPROC", False):
if tr := XSH.env.get("XONSH_TRACE_SUBPROC", False):
tracer = XSH.env.get("XONSH_TRACE_SUBPROC_FUNC", None)
if callable(tracer):
tracer(cmds, captured=captured)
else:
r = {"cmds": cmds, "captured": captured}
print(f"Trace run_subproc({repr(r)})", file=sys.stderr)
if int(trace) == 2:
if tr == 2:
for i, s in enumerate(specs):
pcls = s.cls.__module__ + "." + s.cls.__name__
pcmd = (
Expand Down

0 comments on commit a769689

Please sign in to comment.