duvis 0.1.8

Disk usage visualizer for both AI and humans
Documentation
1
2
3
4
5
6
7
8
9
10
11
// Restore SIGPIPE's default disposition so `duvis ... | head` exits
// silently (process killed by SIGPIPE) instead of surfacing
// `Error: Broken pipe (os error 32)`. Rust runtime ignores SIGPIPE by
// default, which is the wrong behavior for a Unix CLI that streams to
// stdout. Same approach as ripgrep, fd, etc.
pub(super) fn reset_sigpipe() {
    #[cfg(unix)]
    unsafe {
        libc::signal(libc::SIGPIPE, libc::SIG_DFL);
    }
}