diff options
| author | Sai Asish Y <say.apm35@gmail.com> | 2026-05-05 10:08:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-05 10:08:04 -0700 |
| commit | dd9895af6a99be20ad2b91be3edcc6f0e13172ef (patch) | |
| tree | cc1d40d1a9076e2f21ee8748e1574e9fdfcf1dab | |
| parent | chore(deps): bump debian from bookworm-20260202-slim to bookworm-20260421-sli... (diff) | |
| download | atuin-dd9895af6a99be20ad2b91be3edcc6f0e13172ef.zip | |
fix(shell/xonsh): use os.devnull instead of hard-coded /dev/null (#3464)
Refiles a previously-closed PR (#3463) that was closed in error after
the force-push. Same fix; new branch.
Uses inline `@(os.devnull)` per @ltrzesniewski's suggestion in #3463.
Fixes #3462.
Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>
Co-authored-by: SAY-5 <saiasish.cnp@gmail.com>
| -rw-r--r-- | crates/atuin/src/shell/atuin.xsh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/atuin/src/shell/atuin.xsh b/crates/atuin/src/shell/atuin.xsh index 9f45cc6d..a0283402 100644 --- a/crates/atuin/src/shell/atuin.xsh +++ b/crates/atuin/src/shell/atuin.xsh @@ -1,3 +1,4 @@ +import os import subprocess from prompt_toolkit.application.current import get_app @@ -13,7 +14,7 @@ if "ATUIN_SESSION" not in ${...} or ${...}.get("ATUIN_SHLVL", "") != ${...}.get( def _atuin_precommand(cmd: str): cmd = cmd.rstrip("\n") try: - $ATUIN_HISTORY_ID = $(atuin history start -- @(cmd) 2>/dev/null).rstrip("\n") + $ATUIN_HISTORY_ID = $(atuin history start -- @(cmd) 2>@(os.devnull)).rstrip("\n") except: $ATUIN_HISTORY_ID = "" @@ -31,7 +32,7 @@ def _atuin_postcommand(cmd: str, rtn: int, out, ts): # This happens when using a subshell and using output redirection at the same time # For more details, see https://github.com/xonsh/xonsh/issues/5224 # (atuin history end --exit @(rtn) -- $ATUIN_HISTORY_ID &) > /dev/null 2>&1 - atuin history end --exit @(rtn) --duration @(nanos) -- $ATUIN_HISTORY_ID > /dev/null 2>&1 + atuin history end --exit @(rtn) --duration @(nanos) -- $ATUIN_HISTORY_ID > @(os.devnull) 2>&1 del $ATUIN_HISTORY_ID |
