mcfly icon indicating copy to clipboard operation
mcfly copied to clipboard

Visibility issues in terminals with white background

Open curusarn opened this issue 4 years ago • 10 comments

This is how McFly looks like in a terminal with a white background. This one specifically is the gnome-terminal with Xterm color profile with black and white as foreground and background colors respectively. However, it is very likely that this will happen in almost any theme with a white background color.

mcfly-white

The issue seems to be that you are using "color 15" for drawing the foreground text instead of using the foreground color. Here I changed the "color 15" to red in the terminal theme.

mcfly-color15

curusarn avatar Apr 19 '20 21:04 curusarn

Thanks @curusarn. Can an app query for the foreground color and draw using that?

cantino avatar Apr 19 '20 22:04 cantino

The foreground color is the default. You change to different colors with different escape codes and then there is an escape code for resetting the colors.

From https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html:

8 different colors:

Black: \u001b[30m
Red: \u001b[31m
Green: \u001b[32m
Yellow: \u001b[33m
Blue: \u001b[34m
Magenta: \u001b[35m
Cyan: \u001b[36m
White: \u001b[37m
Reset: \u001b[0m

If you are using a library to color the text then there should be some kind of "default" or "reset" functionality provided by the library.

curusarn avatar Apr 19 '20 22:04 curusarn

Does "light mode" not solve this problem? Using the MCFLY_LIGHT environment variable renders text visible on a white background.

freamon avatar May 17 '20 06:05 freamon

MCFLY_LIGHT worked for me. I run a white background and don't see any issues with artifact drawing.

utdrmac avatar Jul 02 '20 20:07 utdrmac

I can reproduce the bug with urxvt and this environment variables:

$ env | grep MCFLY
MCFLY_SESSION_ID=TU1SeEwqMBZgxqaodqjt4aoq
MCFLY_KEY_SCHEME=emacs
MCFLY_LIGHT=TRUE
MCFLY_HISTORY=/tmp/mcfly.3APseccT

2020-08-26-163613

Nevertheless, it works well in Emacs vterm:

2020-08-26-163822

DamienCassou avatar Aug 26 '20 14:08 DamienCassou

I have the same problem, because I use terminal with dark theme, but intellij with light. It would be nice to have either a color which is visible with both or use default colors

szigya avatar Dec 17 '21 12:12 szigya

I have the same problem.

$ env | grep -i mcfly
MCFLY_LIGHT=FALSE
MCFLY_SESSION_ID=0tyrS3WfN8wKhQgyTpfYJkkM
MCFLY_HISTORY=/tmp/mcfly.JGz25H95
MCFLY_HISTORY_FORMAT=zsh-extended

image

EgidioCaprino avatar Apr 09 '22 17:04 EgidioCaprino

MCFLY_LIGHT=FALSE sets the light mode anyway. To use it on a dark background you have to remove that variable declaration.

EgidioCaprino avatar Apr 13 '22 12:04 EgidioCaprino

I had same issue, idk why image

Had someone solved it?

nevermind I started using fzf..

ulises-castro avatar May 31 '22 22:05 ulises-castro

nevermind I started using fzf..

I gave https://github.com/bnprks/mcfly-fzf a try and it works wonderfully to provide the best of both tools!

acesaro avatar Jan 13 '24 02:01 acesaro