Hyper: Add support for color changing escape sequences

Created on 31 Jul 2017  路  13Comments  路  Source: vercel/hyper

  • [x] I am on the latest Hyper.app version
  • [x] 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:

Bug 馃憜 Is Upstream Feature Request

Most helpful comment

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

All 13 comments

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!

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

Thanks!

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 :(

This problem does not appear on OSX.

image

I鈥檒l test this on Arch in an hour or so.

The sequences do not work in vscode.

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.

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

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

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.

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eoinmurray picture eoinmurray  路  3Comments

ConstantinChirila picture ConstantinChirila  路  3Comments

laur1s picture laur1s  路  3Comments

hxnt picture hxnt  路  3Comments

alejandrofloresm picture alejandrofloresm  路  3Comments