Skip to content

Ncurses reports that VSCode integrated terminal can change colors, but redefining colors has no effect #104291

@anthonyk5

Description

@anthonyk5

VS Code version: Code - OSS 1.47.3 (91899dc, 2020-07-30T16:19:47.070Z)
OS version: Linux x64 5.7.11-arch1-1

Steps to Reproduce:

  1. Compile the minimal reproduction program:
#include <curses.h>
int main() {
    initscr();
    start_color();
    if (has_colors() == TRUE && can_change_color() == TRUE) {
        init_color(1, 0, 0, 1000); // redefine red to blue
        init_pair(1, 1, 0); // fg=blue, bg=black
        attron(COLOR_PAIR(1));
        printw("Hello, world!"); // should be blue
        attroff(COLOR_PAIR(1));
        refresh();
        getch();
    }
    endwin();
    return 0;
}

gcc repro.c -lncurses -o repro.out
This program uses Ncurses to redefine the default terminal red color to blue and prints a string with the new color, only if the terminal (as reported by Ncurses) supports colors and redefining colors.

  1. Run repro.out in an external terminal. The text should be blue (assuming your terminal supports colors and redefining them).
  2. Run repro.out in the VSCode integrated terminal. The text will be red (bug).

From the integrated terminal:

echo $TERM
> xterm-256color

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions