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

fish doesn't handle color impaired terminals very well #2951

Closed
krader1961 opened this issue Apr 17, 2016 · 0 comments
Closed

fish doesn't handle color impaired terminals very well #2951

krader1961 opened this issue Apr 17, 2016 · 0 comments

Comments

@krader1961
Copy link
Contributor

A discussion took place regarding the use of the color name "bryellow" in the __fish_cancel_commandline function I recently added.

The first thing to note is that

env TERM=linux fish -c 'set_color bryellow' | xxd

does not produce the error Color not valid in TERM = linux: bryellow as reported by @onodera-punpun. That had me scratching my head until I realized that _share/functions/_fish_config_interactive.fish defines a custom set_color function if $TERM is "linux". Ugh! That is so wrong I don't know where to begin but is somewhat understandable since fish does not honor the number of colors reported by terminfo when that value is eight.

Also, we need to be careful about concatenating the output of set_color with other strings like I did in __fish_cancel_commandline:

echo (set_color -b bryellow black)"^C"(set_color normal)

On monochromatic terminals (e.g., TERM=vt100) a set_color with any color (including "black" and "white") produces no output. Which in turn means the cartesian product of those concatenations is null.

@krader1961 krader1961 self-assigned this Apr 17, 2016
@krader1961 krader1961 added the bug Something that's not working as intended label Apr 17, 2016
@krader1961 krader1961 added this to the next-2.x milestone Apr 17, 2016
@krader1961 krader1961 added enhancement and removed bug Something that's not working as intended labels May 8, 2016
@krader1961 krader1961 removed their assignment Jul 6, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 21, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 23, 2016
Terminals are weird
floam added a commit to floam/fish-shell that referenced this issue Jul 23, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 23, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 23, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 23, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
This should work:

        env TERM=vt100 ./fish -c 'echo (set_color red)"hi"'

Fixes fish-shell#2951.
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
This should work:

        env TERM=vt100 ./fish -c 'echo (set_color red)"hi"'

Fixes fish-shell#2951.
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
This should work:

        env TERM=vt100 ./fish -c 'echo (set_color red)"hi"'

Fixes fish-shell#2951.
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
This should work:

        env TERM=vt100 ./fish -c 'echo (set_color red)"hi"'

Fixes fish-shell#2951.
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
This should work:

        env TERM=vt100 ./fish -c 'echo (set_color red)"hi"'

Fixes fish-shell#2951.
floam added a commit to floam/fish-shell that referenced this issue Jul 24, 2016
This should work:
 > env TERM=vt100 ./fish -c 'echo (set_color red)"hi"'

We do a ::reset() if setting the color doesn't happen.

Fixes fish-shell#2951
floam added a commit to floam/fish-shell that referenced this issue Jul 26, 2016
Fish assumed that it could use tparm to emit escapes to set colors
as long as the color was under 16 or max_colors from terminfo was 256.

Now only uses tparm if max_colors indicates support. Otherwise, use
improved ability to generate color escapes ourselves.

This is what caused "white" not to work in TERM=xterm on Terminal.app, and
obviously isn't good for real low-color terminals either.

Fixes fish-shell#3176

Restores harmony to color white. Adds brwhite, brblack.

Nukes the config.fish set_color hack for linux VTs.

Fixes fish-shell#2951
floam added a commit to floam/fish-shell that referenced this issue Jul 26, 2016
This should work:
 > env TERM=vt100 ./fish -c 'echo (set_color red)"hi"'

We do a ::reset() if setting the color doesn't happen.

Fixes fish-shell#2951
floam added a commit to floam/fish-shell that referenced this issue Sep 11, 2016
This should work:
 > env TERM=vt100 ./fish -c 'echo (set_color red)"hi"'

We do a ::reset() if setting the color doesn't happen.

Fixes fish-shell#2951
@floam floam closed this as completed in 5afd939 Sep 11, 2016
@faho faho modified the milestones: fish 2.4.0, next-2.x Sep 12, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants