From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28811 invoked by alias); 23 Feb 2015 17:24:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34622 Received: (qmail 248 invoked from network); 23 Feb 2015 17:24:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_FSL_HELO_BARE_IP_2 autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1424711649; bh=5hPoeIduK1V3/v2reMbK9PTdAdRodGK40txrJAIamyw=; h=From:To:In-Reply-To:References:Subject:Date; b=dL8oL21+3Uv1FkdZoNlSZmYu2EM809eEUpOOcyEIi5XDX5VBMaJqjr7W/GahXUJyB nwQWt0MyYSFB7fVgmAW+4qOUF5ZVDxE8COmLjFV6YoFnPNxiZZbFeospueeCzTIZHd 4pwFSQFrLdva0LwGMdhSdTehcIgkGDlElQPLeg9o= From: ZyX To: Bart Schaefer , "zsh-workers@zsh.org" In-Reply-To: <150223084750.ZM20328@torch.brasslantern.com> References: <20150222132310.GA18377@wintermute> <150222111007.ZM18687@torch.brasslantern.com> <20150222200735.GA14096__25621.2553395473$1424635776$gmane$org@wintermute> <87fv9wuc6z.fsf@gmail.com> <150223084750.ZM20328@torch.brasslantern.com> Subject: Re: ANSI bg colour outside of prompt area MIME-Version: 1.0 Message-Id: <6174581424711648@web12m.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 23 Feb 2015 20:14:08 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 23.02.2015, 19:48, "Bart Schaefer" : > On Feb 23, 11:58am, Christian Neukirchen wrote: > } > } In xterm and urxvt, you can do > } > } printf '\033]10;%d\a\033]11;%d\a' $fgcolor $bgcolor > > Hmm, that didn't work for me -- it did nothing in xterm, and in urxvt it > changed the background but not the foreground. > > Incidentally $fgcolor and $bgcolor there are numeric codes, not escape > sequences.  If you do > >     autoload colors >     colors > > then you can use e.g. $color[yellow] to get the numeric code. I do not know why Christian Neukirchen thinks fgcolor and bgcolor are supposed to be numeric codes here. You should actually use strings: the following works in urxvt, xterm and konsole: printf '\033]10;%s\a\033]11;%s\a' Blue Red printf '\033]10;%s\a\033]11;%s\a' '#00FF00' '#0000FF' . These are colors recognized by an X11 function, *not* the terminal escape sequences or terminal color numbers. Specification in http://invisible-island.net/xterm/ctlseqs/ctlseqs.html explicitly says that XParseColor function is used to parse color names (“The colors are specified by name or RGB specification as per XParseColor.”). So it is completely useless to have `%d` in `printf` call for xterm.