stderred
stderred copied to clipboard
Using stderred with tmux makes all text red
When using tmux, even when setting STDERRED_BLACKLIST or setting LD_PRELOAD to empty before starting, all text in bash under tmux is highlighted in red. Running bash after entering tmux will revert the text color to the default.
Is there a better fix for this than "run bash"?
~~I guess the issue here is that LD_PRELOAD
contains the stderred.so
twice when you put the export
directive from the documentation verbatim to your ~/.bashrc
because it is run twice (once in the non-tmux
-ed bash
and once in the bash
that tmux
starts for you).~~
~~So either put an include guard in your ~/.bashrc
or start tmux
with (unset LD_PRELOAD; tmux)
(both works for me).~~
EDIT: Just use (unset LD_PRELOAD; tmux)
and you're good.
EDIT: I found that export STDERRED_BLACKLIST='^(-bash)$'
does the trick. I guess it's a good idea to hard-code -bash
in the built-in blacklist as done with the bash
here: https://github.com/sickill/stderred/blob/399e3b199c6de0ac6fdda3c30fb845ff36a75b1f/src/stderred.c#L40
@rico-chet Why not hard-code it and submit a pull request?
@twmccart I wanted to find out first where the leading dash is coming from and whether a non-standard tmux
config would possibly break the check. I found this: https://github.com/tmux/tmux/blob/c9d482ab489d5d57d481858091608ee1b32e46ab/window.c#L993
and this: https://github.com/tmux/tmux/commit/22d1b9412e52c98cbdf52a3a5185a416c6d26c64.
So just checking for the -%s
pattern (not just -bash
) seems much more feasible now.