redact_stdout
Mask environment variable values in show-environment stdout lines.
Source and package
- Qualified name
-
libtmux._internal .log _context. redact _stdout - Module
- libtmux._internal.log_context
- Package
- libtmux
- Source
- src/libtmux/_internal/log_context.py
-
Description
Leaves output from other commands unchanged. Unscoped
show-environmentoutput is validated against tmux'sRB_TREEstrcmpbyte ordering so PEM headers, whitespace-bearing lines, and out-of-order continuations collapse to***; pass-sor a single variable name when a multiline value could contain an=-bearing token that sorts lexicographically after the variable name with no later entries to bound it. Whenshow-environmentis chained with another command or run inside a command carrier, every stdout line is masked to***.Examples
>>> redact_stdout(... ["tmux", "show-environment"],... ["-dash=secret", "EDITOR=vim", "-UNSET_VAR", "continuation"],... )['-dash=***', 'EDITOR=***', '-UNSET_VAR', '***']>>> redact_stdout(... ["tmux", "showenv", "-s"],... ['API_TOKEN="hunter2"; export API_TOKEN;', "unset OLD_VAR;"],... )['API_TOKEN="***"; export API_TOKEN;', 'unset OLD_VAR;']>>> redact_stdout(... ["tmux", "show-environment", ";", "list-sessions"],... ["API_TOKEN=hunter2", "work: 1 windows"],... )['***', '***']>>> redact_stdout(["tmux", "list-sessions"], ["work: 1 windows"])['work: 1 windows']
Recorded calls
source callsThe Python reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls libtmux._internal.log_context.redact_stdout.