SIGHUP: ignore only when in background (stdin not a tty)

Use sys.stdin.isatty() to auto-detect: foreground sessions still
respond to SIGHUP (terminal close kills the process as expected),
background/piped processes ignore it and survive.
This commit is contained in:
catarrh committed 2026-08-11 01:02:07 +03:00
1 parent fb5c1fbf6a
commit f8e9cb1018
2 files changed
+6 -2

No files matched your search

+4 -1
View File
@@ -131,7 +131,10 @@ Non-TPDU messages (ATR, PPS, card state changes, Fi/Di) print identically in all
## Background / Daemon
SIGHUP is ignored by default — terminal closure won't kill the sniffer.
SIGHUP is automatically ignored when stdin is not a terminal (i.e. run in
background or via a pipe). Foreground terminal sessions still respond to
SIGHUP normally.
To run persistently in the background with output to files:
```sh