zsh-workers
 help / color / mirror / code / Atom feed
From: ZyX <kp-pav@yandex.ru>
To: Bart Schaefer <schaefer@brasslantern.com>,
	"zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: ANSI bg colour outside of prompt area
Date: Mon, 23 Feb 2015 20:14:08 +0300	[thread overview]
Message-ID: <6174581424711648@web12m.yandex.ru> (raw)
In-Reply-To: <150223084750.ZM20328@torch.brasslantern.com>

23.02.2015, 19:48, "Bart Schaefer" <schaefer@brasslantern.com>:
> 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.


  parent reply	other threads:[~2015-02-23 17:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20150222132310.GA18377@wintermute>
     [not found] ` <150222111007.ZM18687@torch.brasslantern.com>
     [not found]   ` <20150222200735.GA14096__25621.2553395473$1424635776$gmane$org@wintermute>
2015-02-23 10:58     ` Christian Neukirchen
2015-02-23 16:47       ` Bart Schaefer
2015-02-23 16:55         ` Ray Andrews
2015-02-23 17:14         ` ZyX [this message]
2015-02-23 18:05           ` Ray Andrews
2015-02-23 20:49           ` Christian Neukirchen
2015-02-23 21:20             ` ZyX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6174581424711648@web12m.yandex.ru \
    --to=kp-pav@yandex.ru \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).