Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] background color #2872

Closed
4 tasks done
kkm opened this issue Sep 8, 2023 · 2 comments
Closed
4 tasks done

[Bug] background color #2872

kkm opened this issue Sep 8, 2023 · 2 comments
Labels
👆 ConEmu Upstream issue in ConEmu. ❌ Is Invalid

Comments

@kkm
Copy link

kkm commented Sep 8, 2023

Version Information

Cmder version: latest
Operating system: windows

nodejs:
console.log("color background".yellow.inverse) doesnt work on cmder.

Cmder Edition

Cmder Full (with Git)

Description of the issue

color problem doesnt show background.

How to reproduce

No response

Additional context

No response

Checklist

  • I have read the documentation.
  • I have searched for similar issues and found none that describe my issue.
  • I have reproduced the issue on the latest version of Cmder.
  • I am certain my issues are not related to ConEmu, Clink, or other third-party tools that Cmder uses.
@DRSDavidSoft
Copy link
Contributor

@kkm Hi there, sorry for the delayed response.

Cmder is a pre-configured bundle that consists of a terminal emulator (ConEmu in this case) and some shells. Once you run node.js, Cmder is no longer in control of the output or how it is displayed, which means if there are any issues, it is related to ConEmu.

However, I have personally verified that npm packages work well with ConEmu and Cmder, since all that packages like this are doing is generating some escape code sequences, which will make the text appear in different styles and colors universally in all VT100-like terminals (like ConEmu), regardless of the runtime and software package that generates it. This means that colors.js works as intended in Cmder, too.

Please add some screenshots and tests in other terminals to see if your code is only breaking on Cmder, otherwise we might not be able to help you.

P.S. I strongly suggest switching to a better and sane alternative to the abandoned colors.js package, such as chalk. This is because the Marak, who is the original author of colors.js went ballistic last year and decided to vandalize their own package: Marak/colors.js#285 which means, the latest "official" release from them contains an intentional "bug" that causes an infinite loop and the rest of your code not running at all. It's a great troll effort, but unfortunately the side effect is that you'll be unable to use the latest release in your project.

Either revert back to an un-ruined version of colors.js, or switch to chalk.js which has a different syntax, thus requiring a re-factoring, but it works well and as intended. chalk is what I use in my own projects and it works without any issues.

@DRSDavidSoft DRSDavidSoft closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2023
@kkm
Copy link
Author

kkm commented Feb 22, 2024

cmder:
image

Windows Terminal via Powershell:
image

const colors = require('colors');
console.log("Text Green Only".green);
console.log("Green Text with Background".green.inverse);

@DRSDavidSoft okay thanks for recommend chalk and I didnt know before.

@DRSDavidSoft DRSDavidSoft added the 👆 ConEmu Upstream issue in ConEmu. label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👆 ConEmu Upstream issue in ConEmu. ❌ Is Invalid
Projects
None yet
Development

No branches or pull requests

2 participants