Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: some color fails in command.



On Tue, 08 Aug 2017 12:39:40 -0700
Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
> Gentlemen:
> 
>      echo -e "$fg[red]foo"
>      echo -e "\e[36;1mbar\e[0m"
> 
> Sourced, both work, but if I make the script executable the top one 
> fails (stays B&W) but the second line continues to work as expected.  
> How should I understand that?

The executable file does not pick up whichever start-up file it is in
which you are doing something like

autoload colors
colors

so $fg is not defined.  I'm guessing it's .zshrc.  If you move this to
.zshenv it should work (unless you are explicitly suppressing that with
the -f option).

The second set, being raw escape sequences, are always interpreted by
the terminal.

pws



Messages sorted by: Reverse Date, Date, Thread, Author