#6 Coloring stderr

open
nobody
None
5
2013-01-25
2011-09-28
pir
No

It could be nice if zsh would color stderr natively (depending on an option for sure)

There is a function to put in zshrc
http://www.zsh.org/mla/users/2009/msg00498.html
but due to race conditions sometimes the prompt comes back before stderr, and fuser (for example) gives output kind of shuffled
echo L1; echo L2 >&2; echo L3; echo L4 >&2 is a good test too

I don't know if it's feasible, if not, why ? (i'm curious)

Discussion

  • Marcin Kulik
    Marcin Kulik
    2011-10-20

    +1. Many people would love to see this implemented inside of zsh. For now we all use dirty hacks that are prone to race conditions.

     
  • pir
    pir
    2011-12-12

    Using the function provided in http://www.zsh.org/mla/users/2009/msg00498.html will make your stderr funny.
    $ reset
    reset: standard error: Invalid argument

    And also, in some case (i didn't find exactly how to reproduce, maybe one or more chroot), the ncurses interface of "make menuconfig" is unusable, the arrows print their code ("^[OB").

    Is there a way to reset the stderr on-the-fly? (without editing zshrc and launching a new shell)
    unset -f color_err will not do it.

     
  • Marcin Kulik
    Marcin Kulik
    2011-12-13

    Not strictly zsh solution but you should check out stderred: https://github.com/sickill/stderred