platformio / platformio-atom-ide-terminal

A terminal package for Atom, complete with themes, API and more for PlatformIO IDE
https://atom.io/packages/platformio-ide-terminal
MIT License
613 stars 162 forks source link

output is colored incorrectly for white background #626

Open mattfg opened 5 years ago

mattfg commented 5 years ago

Description

Running the following commands in Windows terminal produces this output:

image

Running the same commands in platformio produces a different output:

image

I've tried with many different color combinations, it only seems to be wrong when background color is white. Foreground white is fine, background any-other-color is fine, it's just background white.

write-host "hello" -ForegroundColor black -BackgroundColor white
write-host "hello" -ForegroundColor red -BackgroundColor white
write-host "hello" -ForegroundColor black -BackgroundColor gray
write-host "hello" -ForegroundColor white -BackgroundColor darkgray

One weird thing is that when background is white AND foreground is black, then both foreground AND background are wrong (foreground becomes white). For other colors, only the background=white is wrong. You can see that in the first command, it's not black-on-black it's white-on-black instead of white-on-red.

In case it makes a difference, my color settings are:

Steps to reproduce

  1. Open a platformio terminal (platformio-ide-terminal:toggle)
  2. Run powershell
  3. run: write-host "hello" -ForegroundColor black -BackgroundColor white write-host "hello" -ForegroundColor red -BackgroundColor white write-host "hello" -ForegroundColor black -BackgroundColor gray write-host "hello" -ForegroundColor white -BackgroundColor darkgray

Expected behavior: The first line of text is black on white. The second line of text is red on white.

Actual behavior: The first line of text is white on black. The second line of text is red on black.

Reproduces how often: 100%

Versions

> atom --version

Atom    : 1.34.0
Electron: 2.0.16
Chrome  : 61.0.3163.100
Node    : 8.9.3

> apm --version

apm  2.1.3
npm  6.2.0
node 8.9.3 x64
atom 1.34.0
python 3.7.0
git
visual studio

OS name and version: Windows 10 Pro 1803 Platformio-ide-terminal version: 2.9.0

Additional Information

config.cson.platformio-ide-terminal:

  "platformio-ide-terminal":
    ansiColors:
      normal:
        blue: "#000080"
        cyan: "#008080"
        green: "#008000"
        magenta: "#800080"
        red: "#800000"
        white: "#808080"
        yellow: "#808000"
      zBright:
        brightBlack: "#404040"
        brightBlue: "#4040c0"
    core:
      mapTerminalsTo: "File"
      mapTerminalsToAutoOpen: true
      workingDirectory: "Active File"
    style:
      fontFamily: "Courier New"
      fontSize: "16"
    toggles:
      autoClose: true
      runInsertedText: false
the-j0k3r commented 5 years ago

Pls upgrade to 2.9.0

the-j0k3r commented 5 years ago

Also @mattfg if issue persists with 2.9.0, Please update your ticket with the information requested in https://raw.githubusercontent.com/platformio/platformio-atom-ide-terminal/master/.github/ISSUE_TEMPLATE.md

On the last are under notes paste your platformio-ide-terminal color configuration and atoms as well.

mattfg commented 5 years ago

Persists with 2.9.0

I've updated the post with as much of the information you asked for as I knew how to collect. I didn't know how to default my settings, and I would rather avoid that unless there's a way to get them back later, but I did at least disable all other packages.

I don't know what you mean by "paste my atoms".

the-j0k3r commented 5 years ago

I don't know what you mean by "paste my atoms".

=) idk where you got "paste my atoms" from, but I meant paste Atoms configuration just in case some portion may be helpful (keeping any private info out (if any exists).

As for resetting Atom, follow https://flight-manual.atom.io/hacking-atom/sections/debugging/#reset-to-factory-defaults You can first make a backup which you can restore after, should you need/want to, that is the recommended procedure by Atom and we wouldnt ask you to nuke everything without a backup. =).

Then reinstall platformio-ide-terminal 2.9.0 via apm in a terminal.

I can actually confirm this issue however, I suspect its term.js a current dependency of the project which is no longer maintained/abandoned for last 4/5 years. We could switch to xterm,js as https://github.com/platformio/platformio-atom-ide-terminal/issues/426 details, but the API has changed and implementation requires a semi experienced js coder willing to work on this.

@ivankravets Ive confirmed this issue, could you have a look please?