console-rs / dialoguer

Rust utility library for nice command line prompts and similar things
MIT License
1.33k stars 142 forks source link

Change chars for `MultiSelect` items #275

Closed Gordon01 closed 1 year ago

Gordon01 commented 1 year ago

Windows Terminal, a widely used terminal emulator for some reason does not support coloring for '✔' char. '✔️' and '❌' may be used instead. They work down to the previous Windows terminal emulator: conhost.exe.

Before:

Windows Terminal

image As you can see, selected and unselected items are indistinguishable.

conhost.exe

image Surprisingly, the old windows emulator is better than new one.

VSCode

image

After:

Windows Terminal

image

conhost.exe

image

VSCode

image

Gordon01 commented 1 year ago

This fixes https://github.com/console-rs/dialoguer/issues/202 with a well-supported character down to early windows-style utf-16ish.

The theme looks good and is consistent on different emulators.

Additional testing is needed for: https://github.com/console-rs/dialoguer/issues/149

pksunkara commented 1 year ago

IMHO, it doesn't look good.

Gordon01 commented 1 year ago

Which new rendering do you think is the worst?

The new VSCode's terminal rendering is questionable.

pksunkara commented 1 year ago

The same rendering is also used for Mac and Linux, where the X emoji does not look good.

Gordon01 commented 1 year ago

What about '☑' '☒' or '✔' '✘' '☓'

Gordon01 commented 1 year ago

'◌' looks good. I removed the color because some emulators drew it black which is invisible on the default black background. Here are a few screenshots.

windows term: image

conhost: image

vscode: image

black is invisible both in windows term and in conhost.exe: image

Gordon01 commented 1 year ago

Linting fails because of: https://github.com/console-rs/dialoguer/pull/209

pksunkara commented 1 year ago

Feel free to fix it in this PR

Gordon01 commented 1 year ago

Linting and changelog fixed.

Gordon01 commented 1 year ago
image image

image