stderred
stderred copied to clipboard
Fix `tmux` text being always red
tmux
(https://github.com/tmux/tmux/wiki) is a terminal multiplexer,
like screen
. It spawns its terminals with argv[0]
prefixed with a
'-', thus breaking stderred
's early return on bash
encounter. This
leads to normal text being always red.
When PROGRAM_NAME
matches the '-%s' format pattern, treat it as a
shell and return early.
Refer to https://github.com/tmux/tmux/blob/c9d482ab489d5d57d481858091608ee1b32e46ab/window.c#L993 and to https://github.com/tmux/tmux/commit/22d1b9412e52c98cbdf52a3a5185a416c6d26c64.
Fixes https://github.com/sickill/stderred/issues/52