Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: multios stripping colors?
- X-seq: zsh-users 23107
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: multios stripping colors?
- Date: Thu, 01 Feb 2018 08:30:16 +0100
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1517470225; bh=/PJpa+xRn+ltenDMDN0b31ApJNc2oUG6H4UXQy+Xc/s=; h=From:References:To:Subject:Date:From:Subject; b=gf31Q3js9b2oDalOANvjUHwjHoAtVY5Ncx8luyu4JQ2iqGcJjhDdqyBfW8qKpuLa+ROeJONPYT9D1oa2ZDTfZSXLs4b3ijEtKu7FvT/XcscKC1uPfoYGnXlA9IGG3hXymHSsWiy5243JCUqr7Mbp49pc5nbx14/qh7st9QqrHqB8RSmk1o3YthHhdSCSew4CqnOhRbv2xkI6EeVmBI+Y8kyFpiXJTvYmRZ2cX6GNj1pney+cgC1pOmtdQATDZqp7OsMS8tkg0QzcnD7q9d5y19CnKgedUUkuYt2ke1qcGe3D2DtUVyOt/zGrFEHs3DocOfXga+QFu2lOQ8ikKVki/Q==
- In-reply-to: <7771fca9-b248-3159-8597-65ddb057214d@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <7771fca9-b248-3159-8597-65ddb057214d@eastlink.ca>
Ray Andrews wrote:
>
> $ eval "$@"
>
> That line in a function of mine can successfully eat some very complex
> input including various pipes and color codes. However, when I try this:
eval "eats" only shell syntax. Colour codes are eaten by your
terminal. Perhaps you contrived to prevent them being generated or
constructed something to filter them out.
> $ eval "$@" >&2 >! /tmp/_output
>
> Although I do get both outputs, the screen looses all colorized output
There is nothing intrinsic to your construct that loses colour escape
sequences. Try the following:
eval "print -P '%K{blue}Hello'" >&2 >! /tmp/_output
cat /tmp/_output
This should give you a blue background from both commands.
So you might need to take a closer look at exactly what argument you are
passing to eval.
Some commands, make coloured output conditional on whether their
standard output points to a terminal. For an example, try:
git log | cat
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author