* Terminal theme tool – a workaround for lack of 24-bit color in Zsh?
@ 2018-10-15 15:28 Sebastian Gniazdowski
2018-11-15 14:48 ` Sebastian Gniazdowski
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Sebastian Gniazdowski @ 2018-10-15 15:28 UTC (permalink / raw)
To: Zsh Users
Hello!
There are 2 escape sequences, ESC]4;n;#rrggbb\a and ESC]Pnrrggbb, that
allow to change terminal's current palette. First works on most
OpenSource / Linux terminals and supports 256 colors, second one on OS
X iTerm, supporting first 16 colors only. (I've submitted a ticket for
1st code on iTerm GitLab project page
https://gitlab.com/gnachman/iterm2/issues/7221, you could support it
by commenting in favor of the feature or by giving thumbs up).
I'm wondering why there is no tool to manage terminal-themes? Many
things, in particular syntax highlighting of Zsh command-line, can
easily gain from this. It's essentially a workaround for the lack of
24-bit color in Zsh. As a result I've decided to extend F-Sy-H theme
support with terminal-palette altering, it should be there within a
month.
I'm curious on opinions whether this really is a workaround for no
true-color support in Zsh and maybe on ideas of what such
terminal-theme manager should do.
You can play with this feature – xterm, urxvt, gnome-terminal:
echo -e '\e[32m'Test Color Text ▓▓▓▓'\e[0m'
sleep 2
echo -ne '\e]4;2;#aaaa00\a'
OS X / iTerm:
echo -e '\e[32m'Test Color Text ▓▓▓▓'\e[0m'
sleep 2
echo -en '\e]P2aaaa00'
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Terminal theme tool – a workaround for lack of 24-bit color in Zsh?
2018-10-15 15:28 Terminal theme tool – a workaround for lack of 24-bit color in Zsh? Sebastian Gniazdowski
@ 2018-11-15 14:48 ` Sebastian Gniazdowski
2018-11-19 12:07 ` Magnus Woldrich
2018-11-22 19:06 ` Sebastian Gniazdowski
2 siblings, 0 replies; 6+ messages in thread
From: Sebastian Gniazdowski @ 2018-11-15 14:48 UTC (permalink / raw)
To: Zsh Users
BTW. By using the new, probably incoming (the author is working on
needed changes) feature of the `unixorn/awesome-zsh-plugins` list – an
evaluation of plugins (see an example at:
https://github.com/zdharma/hacking-private/blob/master/zsh-plugin-assessor/README_new.md),
I've found a plugin that to some extend does what the proposed
terminal-theme-tool would be doing:
https://github.com/chriskempson/base16-shell
On Mon, 15 Oct 2018 at 17:28, Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
>
> Hello!
> There are 2 escape sequences, ESC]4;n;#rrggbb\a and ESC]Pnrrggbb, that
> allow to change terminal's current palette. First works on most
> OpenSource / Linux terminals and supports 256 colors, second one on OS
> X iTerm, supporting first 16 colors only. (I've submitted a ticket for
> 1st code on iTerm GitLab project page
> https://gitlab.com/gnachman/iterm2/issues/7221, you could support it
> by commenting in favor of the feature or by giving thumbs up).
>
> I'm wondering why there is no tool to manage terminal-themes? Many
> things, in particular syntax highlighting of Zsh command-line, can
> easily gain from this. It's essentially a workaround for the lack of
> 24-bit color in Zsh. As a result I've decided to extend F-Sy-H theme
> support with terminal-palette altering, it should be there within a
> month.
>
> I'm curious on opinions whether this really is a workaround for no
> true-color support in Zsh and maybe on ideas of what such
> terminal-theme manager should do.
>
> You can play with this feature – xterm, urxvt, gnome-terminal:
>
> echo -e '\e[32m'Test Color Text ▓▓▓▓'\e[0m'
> sleep 2
> echo -ne '\e]4;2;#aaaa00\a'
>
> OS X / iTerm:
>
> echo -e '\e[32m'Test Color Text ▓▓▓▓'\e[0m'
> sleep 2
> echo -en '\e]P2aaaa00'
>
> --
> Sebastian Gniazdowski
> News: https://twitter.com/ZdharmaI
> IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
> Blog: http://zdharma.org
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Terminal theme tool – a workaround for lack of 24-bit color in Zsh?
2018-10-15 15:28 Terminal theme tool – a workaround for lack of 24-bit color in Zsh? Sebastian Gniazdowski
2018-11-15 14:48 ` Sebastian Gniazdowski
@ 2018-11-19 12:07 ` Magnus Woldrich
2018-11-22 14:43 ` Sebastian Gniazdowski
2018-11-22 19:06 ` Sebastian Gniazdowski
2 siblings, 1 reply; 6+ messages in thread
From: Magnus Woldrich @ 2018-11-19 12:07 UTC (permalink / raw)
To: Sebastian Gniazdowski; +Cc: Zsh Users
> I'm wondering why there is no tool to manage terminal-themes?
I've done some work (ab)using this.
https://github.com/trapd00r/colorcoke/wiki
https://github.com/trapd00r/Term-ExtendedColor-Xresources
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Terminal theme tool – a workaround for lack of 24-bit color in Zsh?
2018-11-19 12:07 ` Magnus Woldrich
@ 2018-11-22 14:43 ` Sebastian Gniazdowski
2018-11-22 17:15 ` Magnus Woldrich
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Gniazdowski @ 2018-11-22 14:43 UTC (permalink / raw)
To: m; +Cc: Zsh Users
On Mon, 19 Nov 2018 at 13:07, Magnus Woldrich <m@japh.se> wrote:
>
> > I'm wondering why there is no tool to manage terminal-themes?
>
> I've done some work (ab)using this.
> https://github.com/trapd00r/colorcoke/wiki
> https://github.com/trapd00r/Term-ExtendedColor-Xresources
Does this tool support iTerm? It has, apparently unofficial, Escape
for changing the colors:
https://gitlab.com/gnachman/iterm2/issues/7221
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Terminal theme tool – a workaround for lack of 24-bit color in Zsh?
2018-11-22 14:43 ` Sebastian Gniazdowski
@ 2018-11-22 17:15 ` Magnus Woldrich
0 siblings, 0 replies; 6+ messages in thread
From: Magnus Woldrich @ 2018-11-22 17:15 UTC (permalink / raw)
To: Sebastian Gniazdowski; +Cc: Zsh Users
> Does this tool support iTerm? It has, apparently unofficial, Escape
> for changing the colors:
From that post:
"Overall, this control sequence works in xterm, gnome-terminal and
urxvt. It seems that OS X terminals are lagging behind, I've tested
Terminal.app, iTerm and ExtraTerm and found no support for the
\e]4;n;#rrggbb\a sequence. Only \e]P2aa00aa is supported, but it
allows to alter only first 16 colors in the palette (the number after
char P can be only 0..f)."
So, that'd be a no.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Terminal theme tool – a workaround for lack of 24-bit color in Zsh?
2018-10-15 15:28 Terminal theme tool – a workaround for lack of 24-bit color in Zsh? Sebastian Gniazdowski
2018-11-15 14:48 ` Sebastian Gniazdowski
2018-11-19 12:07 ` Magnus Woldrich
@ 2018-11-22 19:06 ` Sebastian Gniazdowski
2 siblings, 0 replies; 6+ messages in thread
From: Sebastian Gniazdowski @ 2018-11-22 19:06 UTC (permalink / raw)
To: Zsh Users
This is an update to the first post. I've done a research on iTerm and
it turned out it can change all the 256 colors and also terminal's
background and foreground color. So the following isn't true:
On Mon, 15 Oct 2018 at 17:28, Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
> Hello!
> There are 2 escape sequences, ESC]4;n;#rrggbb\a and ESC]Pnrrggbb, that
> allow to change terminal's current palette. First works on most
> OpenSource / Linux terminals and supports 256 colors, second one on OS
> X iTerm, supporting first 16 colors only.
The new iTerm2 sequence is:
\e]4; index ;rgb: red / green / blue \a
An example that changes 1st color (index=1), i.e. the red (try also 2
for the green, for example).
echo -en '\e]4;1;rgb:aa/ff/00\a'
More details are in the iTerm2 gitlab's issue:
https://gitlab.com/gnachman/iterm2/issues/7221
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-11-22 19:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-15 15:28 Terminal theme tool – a workaround for lack of 24-bit color in Zsh? Sebastian Gniazdowski
2018-11-15 14:48 ` Sebastian Gniazdowski
2018-11-19 12:07 ` Magnus Woldrich
2018-11-22 14:43 ` Sebastian Gniazdowski
2018-11-22 17:15 ` Magnus Woldrich
2018-11-22 19:06 ` Sebastian Gniazdowski
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).