Skip to content

Commit 451573b

Browse files
committed
server(fix[raise_if_dead]): suppress check_call stdout/stderr
why: subprocess.check_call without stdout/stderr redirection inherits the parent process's file descriptors, printing tmux output directly to the terminal. Library code should not produce terminal noise. what: - Pass stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL to check_call
1 parent 3a6fb89 commit 451573b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/libtmux/server.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,11 @@ def raise_if_dead(self) -> None:
247247
cmd_args.insert(0, f"-f{self.config_file}")
248248

249249
try:
250-
subprocess.check_call([resolved, *cmd_args])
250+
subprocess.check_call(
251+
[resolved, *cmd_args],
252+
stdout=subprocess.DEVNULL,
253+
stderr=subprocess.DEVNULL,
254+
)
251255
except FileNotFoundError:
252256
raise exc.TmuxCommandNotFound from None
253257

0 commit comments

Comments
 (0)