stderred icon indicating copy to clipboard operation
stderred copied to clipboard

Using stderred with tmux makes all text red

Open andrewbenton opened this issue 8 years ago • 4 comments

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.

andrewbenton avatar Sep 06 '16 03:09 andrewbenton

Is there a better fix for this than "run bash"?

twmccart avatar Nov 08 '18 17:11 twmccart

~~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 avatar Dec 29 '18 00:12 rico-chet

@rico-chet Why not hard-code it and submit a pull request?

twmccart avatar Jan 02 '19 18:01 twmccart

@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.

rico-chet avatar Jan 03 '19 02:01 rico-chet