question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
slawekzachcialcommented, Dec 10, 2020

For information, I’ve been working on #3163 that, once finished and if merged, would provide support to set colors using OSC 4 sequences.

2reactions
inoyatovcommented, Jun 6, 2018

@jerch not permanently it will last until terminal session ends. Which means if you reload xterm colors will reset to original.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found