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

Option to disable bold text changing to bright colors #5361

Open
Moarram opened this issue Feb 27, 2021 · 3 comments · May be fixed by #7019
Open

Option to disable bold text changing to bright colors #5361

Moarram opened this issue Feb 27, 2021 · 3 comments · May be fixed by #7019
Labels
🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper

Comments

@Moarram
Copy link

Moarram commented Feb 27, 2021

Is your feature request related to a problem? Please describe.
I don't want the color of bold text to change to the brighter version.

Describe the solution you'd like
I want an option to turn off the bold text color change.

In the underlying xterm.js library, there is a flag in ITerminalOptions called drawBoldTextInBrightColors, which by default is set true. I assume that setting this flag false will give my desired behavior. Can this be exposed as an option in the hyper.js config file? It looks like the getTermOptions function in hyper/lib/components/term.tsx can be changed to accept this additional option. Probably needs to be changed in other places as well.

I'm not the first to bring up this issue, but I haven't seen anyone mention the flag in the xterm.js library, so I assume it's relatively new. If that flag works as described, this should be a straightforward feature to implement.

Describe alternatives you've considered
I looked into making a plugin, but it doesn't look like the right way to solve this problem.

Additional context
Screenshot shows current unwanted behavior:
Screen Shot 2021-02-26 at 8 14 31 PM

@LabhanshAgrawal LabhanshAgrawal added the 🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper label Feb 27, 2021
@LabhanshAgrawal
Copy link
Collaborator

Can you link the other issues about this and also give example command to test it (few different colors)

@Moarram
Copy link
Author

Moarram commented Feb 28, 2021

The flag in question was added to xterm.js as described by xtermjs/xterm.js#1391. That version of xterm.js was merged into Hyper with the intent of providing this feature according to issue #2836. Unless I am missing something, it's not actually possible to set this xterm.js flag in Hyper right now.

@Moarram
Copy link
Author

Moarram commented Feb 28, 2021

This isn't a zsh or zsh prompt specific issue, although that's where I first noticed it. I can also reproduce it using standard ANSI escape codes. Make sure your basic colors (0-7) are set different than the bright variants (8-15) in your Hyper config file so that you may easily distinguish them. Here is a Python script to show the behavior.

colors = list(range(30, 38)) + list(range(90, 98)) # ANSI escape codes
print('normal: ', end='')
for c in colors:
    print(f'\33[{c}m {c}', end='')
print('\33[1m') # bold
print('bold:   ', end='')
for c in colors:
    print(f'\33[{c}m {c}', end='')
print('\33[0m') # reset
print('')

You will see that the first 8 bold colors are undesirably showing the bright version (color + 8).

Screen Shot 2021-02-27 at 6 45 21 PM

@comicchang comicchang linked a pull request Feb 8, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 Type: Feature Request Issue or PR is a feature request/proposal for Hyper
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants