Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for color changing escape sequences #2038

Closed
2 tasks done
dylanaraps opened this issue Jul 31, 2017 · 17 comments
Closed
2 tasks done

Add support for color changing escape sequences #2038

dylanaraps opened this issue Jul 31, 2017 · 17 comments
Labels
👆 Is Upstream Issue is the fault of something Hyper uses and not Hyper itself 🐛 Type: Bug Issue pertains to something wrong within Hyper 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper

Comments

@dylanaraps
Copy link

  • I am on the latest Hyper.app version
  • I have searched the issues of this repo and believe that this is not a duplicate
  • OS version and name: Arch Linux
  • Hyper.app version: 1.3.3
  • Link of a Gist with the contents of your .hyper.js: No changes made to default config. (N/A)
  • Relevant information from devtools: N/A
  • The issue is reproducible in vanilla Hyper.app: Yes

Issue

These escape sequences manipulate the open terminal's colorscheme and allow you to change your terminal's colorscheme on the fly. These escape sequences are supported by all of the terminal emulators I've tried with the exception of konsole which ignores them.

Two of my projects use these escape sequences for their main purpose and they currently don't work in Alacritty since the sequences aren't yet supported.

I fully understand if you don't want to implement this feature, there are a lot of really weird escape sequences in the Xterm/Rxvt specs and I understand that you want to keep Hyper simple. ^^

The sequences are as follows:

# Manipulate colors 0-256
# \033]4;{index};{color}\007

# Change color 7 to #FFFFFF
\033]4;7;#FFFFFF\007

# Change color 14 to #333333
\033]4;14;#333333\007

# Manipulate special colors.
# 10 = foreground, 11 = background, 12 = cursor foregound
# 13 = mouse foreground, 708 = terminal border background
# \033]{index};{color}\007

# Change the terminal foreground to #FFFFFF
\033]10;#FFFFFF\007

# Change the terminal background to #000000
\033]11;#000000\007

# Change the terminal cursor to #FFFFFF
\033]12;#FFFFFF\007

# Change the terminal border background to #000000
\033]708;#000000\007

Source:

More information:

@dylanaraps dylanaraps changed the title Add support for color changing escape sequences. Add support for color changing escape sequences Jul 31, 2017
@Stanzilla Stanzilla added 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper 👆 Is Upstream Issue is the fault of something Hyper uses and not Hyper itself labels Apr 24, 2018
@Stanzilla
Copy link
Collaborator

Hey there, to verify if this is indeed a Hyper issue or upstream at https://github.com/xtermjs/xterm.js/ could you please test if another xterm.js powered terminal shows the same problem you are experiencing? I suggest using https://github.com/Microsoft/vscode for testing. Thanks!

@johnsonwj
Copy link

johnsonwj commented Apr 25, 2018

@Stanzilla I have verified that this works in VS Code:

Terminal Colors - VS Code

VS Code version info:

Version 1.22.2
Commit 3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9
Date 2018-04-12T16:38:45.278Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

However, the colors are displayed as escape characters in Hyper:

Terminal Colors - Hyper

Here's my about screen:

Hyper - About

I have tried this with and without the zenburn plugin.

@Stanzilla
Copy link
Collaborator

Thanks!

@Stanzilla Stanzilla added 🐛 Type: Bug Issue pertains to something wrong within Hyper and removed 👆 Is Upstream Issue is the fault of something Hyper uses and not Hyper itself labels Apr 25, 2018
@johnsonwj
Copy link

PS - in case this wasn't obvious from the screenshots, I am on Windows 10 ... I don't have an arch box handy to try to repro this from the original report :(

@johnsonwj
Copy link

This problem does not appear on OSX.

image

@dylanaraps
Copy link
Author

I’ll test this on Arch in an hour or so.

@dylanaraps
Copy link
Author

The sequences do not work in vscode.

@Stanzilla Stanzilla added the 👆 Is Upstream Issue is the fault of something Hyper uses and not Hyper itself label Apr 29, 2018
@johnsonwj
Copy link

Yeah, actually today they are not working for me in VS Code either...I am not sure what changed in the meantime. I am using the same version.

@vivekvjn
Copy link

vivekvjn commented Oct 3, 2018

Try echo -e '\e[31m 767M \e[41m____________________\e[m \e[31mdir1/\e[m'
It works for me in putty, VS Code etc.
image
but this does not work on Hyper:
image
although, if I don't set foreground color, it works:
image

Using Hyper 2.0.0 on WSL
image

@seve
Copy link

seve commented Feb 20, 2019

Wondering about the status of this issue. Is there a current fix for changing the colorscheme via wal/pywal?

@matteomeli
Copy link

matteomeli commented Mar 20, 2019

I got around this issue on Windows 10 adding a value in the registry. Add a REG_DWORD type variable called VirtualTerminalLevel with an hexadecimal value of 1 at Computer\HKEY_CURRENT_USER\Console and restart hyper. It should recognize color escape sequences correctly then.

@LabhanshAgrawal
Copy link
Collaborator

LabhanshAgrawal commented Jul 1, 2020

Tested echo -e '\e[31m 767M \e[41m____________________\e[m \e[31mdir1/\e[m'
on mac, windows & ubuntu using the latest canary build
Screenshot 2020-07-04 at 11 06 49
It seems to be working well
Feel free to open a new issue if you face any other problems

@dylanaraps
Copy link
Author

dylanaraps commented Aug 1, 2020

@LabhanshAgrawal Those aren't the sequences I am talking about. Please reopen this issue and please carefully read my initial post.

@LabhanshAgrawal
Copy link
Collaborator

I had closed this based on earlier comment by vivek
@dylanaraps can you give any command to test it
I get this when I run the command from pywal wiki
Screenshot 2021-02-08 at 12 26 50
nothing is printed or changed in the rest of the terminal for me
is this ok?

@ihucos
Copy link

ihucos commented Jul 21, 2021

This is a command to test it. When running this on e.G. xterm, the color scheme will change to solarized dark.

(As always take a look at it before pasting into the terminal)

printf '\x1b]12;#dc302f\x07\x1b]11;#002b36\x07\x1b]10;#839496\x07\x1b]708;#002b36\x07\x1b]4;0;#073642\x07\x1b]4;1;#dc302f\x07\x1b]4;2;#859900\x07\x1b]4;3;#b58900\x07\x1b]4;4;#268bd2\x07\x1b]4;5;#d33681\x07\x1b]4;6;#29a198\x07\x1b]4;7;#eee8d5\x07\x1b]4;9;#cb4b16\x07\x1b]4;8;#002b36\x07\x1b]4;10;#586d75\x07\x1b]4;11;#657b83\x07\x1b]4;12;#839496\x07\x1b]4;13;#6c71c4\x07\x1b]4;14;#93a1a1\x07\x1b]4;15;#fdf6e3\x07'

@rstacruz
Copy link

I'm confirming that this works well on Windows 11 with Hyper 3.1.5.

image

@LabhanshAgrawal
Copy link
Collaborator

Closing as fixed (added in xterm 4.16)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👆 Is Upstream Issue is the fault of something Hyper uses and not Hyper itself 🐛 Type: Bug Issue pertains to something wrong within Hyper 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper
Projects
None yet
Development

No branches or pull requests

9 participants