Skip to content

Add support for setting colors using "Operation System Command" sequence. #1493

@inoyatov

Description

@inoyatov

In traditional terminals which support 256 color, (Gnome terminal, xterm, iTerm and etc.) colors can be set using Operation System Command sequence. In example: printf "\033]4;18;rgb:ff/00/00\033\\". Where \033 escape character and 4 means color set command, followed by color number 18 and color in RGB with closing `\033\' escape sequence. However, terminals which built using xterm.js (VC's internal terminal or Hyper terminal) dose not reflect system color change commands.

Details

  • Browser and browser version: I tested it under VSCode IDE and Hyper.is terminal which uses internal xterm.js
  • OS version: Ubuntu 16.04 LTS
  • xterm.js version: Depends on VSCode IDE and Hyper.is

Steps to reproduce

  1. Input following printf "\033]4;18;rgb:ff/00/00\033\\" in Gnome terminal and Hyper or VC's terminal for comparison.
  2. And then input following printf "\033[38;5;18mWhat color is it?\033[0m\n". It shows "What color is it?" in RED color on the gnome terminal however on Hyper terminal it shows blue (Images attached). Changes by previous command was not reflected to xterm.js.

So, it would be nice if it will be added to xterm.js since there is many color themes which require custom colors.
Gnome output:
gnome-output

Hyper output:
hyper-output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions