zsh-workers
 help / color / mirror / code / Atom feed
* Re: ANSI bg colour outside of prompt area
       [not found]   ` <20150222200735.GA14096__25621.2553395473$1424635776$gmane$org@wintermute>
@ 2015-02-23 10:58     ` Christian Neukirchen
  2015-02-23 16:47       ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Neukirchen @ 2015-02-23 10:58 UTC (permalink / raw)
  To: zsh-workers

junkcommander0@gmail.com writes:

> As a workaround for now I have a little alias that switches the value
> of the background colour in st's config.h, and recompiles it. It's not
> quite the same as toggling it in the terminal I'm working in, but it's
> not terribly difficult to open a new terminal with a different
> background colour.

In xterm and urxvt, you can do

printf '\033]10;%d\a\033]11;%d\a' $fgcolor $bgcolor

-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ANSI bg colour outside of prompt area
  2015-02-23 10:58     ` ANSI bg colour outside of prompt area Christian Neukirchen
@ 2015-02-23 16:47       ` Bart Schaefer
  2015-02-23 16:55         ` Ray Andrews
  2015-02-23 17:14         ` ZyX
  0 siblings, 2 replies; 7+ messages in thread
From: Bart Schaefer @ 2015-02-23 16:47 UTC (permalink / raw)
  To: zsh-workers

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ANSI bg colour outside of prompt area
  2015-02-23 16:47       ` Bart Schaefer
@ 2015-02-23 16:55         ` Ray Andrews
  2015-02-23 17:14         ` ZyX
  1 sibling, 0 replies; 7+ messages in thread
From: Ray Andrews @ 2015-02-23 16:55 UTC (permalink / raw)
  To: zsh-workers

On 02/23/2015 08:47 AM, Bart Schaefer wrote:
> 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.

Same here for xterm and xfce4-terminal (no result).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ANSI bg colour outside of prompt area
  2015-02-23 16:47       ` Bart Schaefer
  2015-02-23 16:55         ` Ray Andrews
@ 2015-02-23 17:14         ` ZyX
  2015-02-23 18:05           ` Ray Andrews
  2015-02-23 20:49           ` Christian Neukirchen
  1 sibling, 2 replies; 7+ messages in thread
From: ZyX @ 2015-02-23 17:14 UTC (permalink / raw)
  To: Bart Schaefer, zsh-workers

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ANSI bg colour outside of prompt area
  2015-02-23 17:14         ` ZyX
@ 2015-02-23 18:05           ` Ray Andrews
  2015-02-23 20:49           ` Christian Neukirchen
  1 sibling, 0 replies; 7+ messages in thread
From: Ray Andrews @ 2015-02-23 18:05 UTC (permalink / raw)
  To: zsh-workers

On 02/23/2015 09:14 AM, ZyX wrote:
> printf '\033]10;%s\a\033]11;%s\a' Blue Red
Works here in xterm, but not xfce4-terminal.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ANSI bg colour outside of prompt area
  2015-02-23 17:14         ` ZyX
  2015-02-23 18:05           ` Ray Andrews
@ 2015-02-23 20:49           ` Christian Neukirchen
  2015-02-23 21:20             ` ZyX
  1 sibling, 1 reply; 7+ messages in thread
From: Christian Neukirchen @ 2015-02-23 20:49 UTC (permalink / raw)
  To: zsh-workers

ZyX <kp-pav@yandex.ru> writes:

> 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.

I read urxvt(7) and tested it, and assumed they implement "XTerm
Operating System Commands" like xterm. ;)

But this is even more useful.

-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ANSI bg colour outside of prompt area
  2015-02-23 20:49           ` Christian Neukirchen
@ 2015-02-23 21:20             ` ZyX
  0 siblings, 0 replies; 7+ messages in thread
From: ZyX @ 2015-02-23 21:20 UTC (permalink / raw)
  To: Christian Neukirchen, zsh-workers

23.02.2015, 23:50, "Christian Neukirchen" <chneukirchen@gmail.com>:
> ZyX <kp-pav@yandex.ru> writes:
>>  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.
>
> I read urxvt(7) and tested it, and assumed they implement "XTerm
> Operating System Commands" like xterm. ;)

They do. It is xterm documentation that points out that XParseColor should be used, pointing out explicitly that colors may be specified by name or RGB specification. I have tried replacing Blue and Red with numbers and this is not working in xterm, neither it is in konsole. Rxvt-unicode indeed does something when it receives numbers in place of Blue and Red, but this is the only terminal that does this I have (also not the primary one (used to be once, changed to konsole due to a) 24-bit color support and b) much easier configuration if you need powerline fonts)), and this is going directly against original specification which specifies *only* XParseColor.

By the way, other color options supported by XParseColor are as well supported by konsole, xterm and urxvt. I have not tried all variants, but at least CIEXYZ:0.5/0.5/0.5 works.

>
> But this is even more useful.
>
> --
> Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-23 21:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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     ` ANSI bg colour outside of prompt area Christian Neukirchen
2015-02-23 16:47       ` Bart Schaefer
2015-02-23 16:55         ` Ray Andrews
2015-02-23 17:14         ` ZyX
2015-02-23 18:05           ` Ray Andrews
2015-02-23 20:49           ` Christian Neukirchen
2015-02-23 21:20             ` ZyX

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).