SIGN IN SIGN UP
hyprwm / Hyprland UNCLAIMED

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.

0 0 48 C++

Set child stdout and stderr to /dev/null (#1000)

Some scripts or utilities check to see if stdout or stderr are connected
to a TTY or not to determine certain behaviors (for example, you might
want to prompt a user for input with fzf(1) if in a terminal but tofi(1)
or wofi(1) when spawned from your WM).  Since hyprland never closes
these output streams for spawned processes, they end up just spewing
their output onto the TTY while giving the user no real way to have a
script detect if it's being run from the shell or WM.

Instead of just closing stdout and stderr though, we close them and then
proceed to reopen them but connect them to /dev/null.  This allows
scripts and processes to not fail when attempting to write, but for that
writing to simply have no effect.
T
Thomas Voss committed
1e5cab1ee7a82d3381f55963a0ff768c30215602
Parent: 5a00f0c
Committed by GitHub <noreply@github.com> on 11/13/2022, 11:58:20 AM