Add support for setting colors using "Operation System Command" sequence.
See original GitHub issueIn 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
- Input following
printf "\033]4;18;rgb:ff/00/00\033\\"
in Gnome terminal and Hyper or VC’s terminal for comparison. - 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:
Hyper output:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:17 (9 by maintainers)
Top Results From Across the Web
How can I change the colors of my xterm using Ansi escape ...
I've heard that this can be done using ANSI escape sequences. If this is possible: How is it done? Can I use color...
Read more >Build your own Command Line with ANSI escape codes
The most basic Ansi escape codes are those involved in rendering text. These let you add decorations like Colors, Background Colors or other ......
Read more >Coloring Terminal Text: tput and ANSI Escape Sequences
ANSI escape sequences and the tput command can add style and color to the text displayed in the terminal. Let's learn how to...
Read more >Colorize Terminal Text with Escape Sequences in Linux
Style Your Terminal Text With Escape codes (or Sequences) In Linux. Print colored output text or change text background color in Linux terminal...
Read more >using ANSI escape codes on Windows, macOS and Linux ...
Changing the stdin mode requires OS specific code, for example on Posix systems you will use functions from termios.h and on Windows functions ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For information, I’ve been working on #3163 that, once finished and if merged, would provide support to set colors using OSC 4 sequences.
@jerch not permanently it will last until terminal session ends. Which means if you reload xterm colors will reset to original.