ttscoff / mdless

MIT License
871 stars 39 forks source link

[help] How to force default color to be white rather than gray #72

Closed avatar-lavventura closed 11 months ago

avatar-lavventura commented 3 years ago

I want to force to see the default color of text under all headers' as white. But some of them represented as light-gray (not sure bold white's color may changed as gray). How can I make them represented as white?

When I connect into my remote node using ssh, example view of mdless FILE.md:

image

This does not happen when I open the same file using terminal inside the Ubuntu GUI, where it shown as white.

ttscoff commented 3 years ago

The default color should be whatever your command line foreground text is set to. For non-highlighted text, mdless sends the \[0m escape code, reverting to whatever your terminal theme's default foreground is. I'm not sure why it would be different over ssh.

It would be feasible to replace all occurrences of the 0m command with a theme-able foreground color. If I find time to dig back into this, I'll look at making that possible.

-Brett

On 26 Aug 2021, at 7:14, Alper Alimoglu wrote:

I want to force to see the default color as white. But some of them represented as gray. How can I make them represented as white?

When I connect into my remote node using ssh, example view:

<img width="515" alt="image" src="https://user-images.githubusercontent.com/18537398/130960314-47255147-5619-462c-89b0-d0c665d46d19.png">

This does not happen when I open the same file using terminal inside the Ubuntu GUI, where it shown as white.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/72

avatar-lavventura commented 3 years ago

After double checking it happens in my Terminal (iTerm2) as well, hence it shouldn't be over ssh. Also I am using dracula theme (https://github.com/dracula/iterm), with following color setup:

image
ttscoff commented 3 years ago

The "Foreground" color is what's going to show up as the default text in mdless. If you changed that to white and you'd get the results you're looking for.

avatar-lavventura commented 3 years ago

I have changed Foreground color into white but it didn't make any change, seems like the issue is related to something else :-(

ttscoff commented 3 years ago

Does your prompt send color escapes without resetting (0m) at all?

On 27 Aug 2021, at 13:28, Alper Alimoglu wrote:

I have change Foreground color into white but it didn't make any change :-(

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/72#issuecomment-907392461

avatar-lavventura commented 3 years ago

How can I unreset 0m to test it?

ttscoff commented 3 years ago

Syntax can vary a bit depending on your shell/emulator, but in a prompt you can usually end with \e[0m to send a reset code.

Might not be the issue at all, but it's all I can think of.

On 27 Aug 2021, at 16:18, Alper Alimoglu wrote:

How can I unreset 0m to test it?

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/72#issuecomment-907481960

avatar-lavventura commented 3 years ago

I have following setup not sure might help:

export LESS_TERMCAP_mb=$'\E[6m'        # begin blinking
export LESS_TERMCAP_md=$'\E[34m'       # begin bold
export LESS_TERMCAP_us=$'\E[4;32m'     # begin underline
export LESS_TERMCAP_me=$'\E[0m'        # end mode
export LESS_TERMCAP_ue=$'\E[0m'        # end underline
export LESS_TERMCAP_se=$'\E[0m'        # end standout-mode
export LESS_TERMCAP_so=$'\E[1;33;33m'  # begin standout-mode - info box