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

renderer: use fg as extension color for covering glyphs (U+2588) #2117

Merged
merged 1 commit into from
Aug 18, 2024

Conversation

mitchellh
Copy link
Contributor

Fixes #2099

This is another heuristic of sorts to make window-padding-color=extend look better by default. If a fully covering glyph is used then we use the fg color to extend rather than the background.

This doesn't account for fonts that may do this for whatever codepoints, but I think that's a special scenario that we should just recommend disabling this feature.

@mitchellh
Copy link
Contributor Author

Seeing some issues with Metal still, I suspect some Metal shader issue but not sure yet.

The shell script below reproduces. On my system it produces the following image, all red blocks should be extended. They are on OpenGL:

CleanShot 2024-08-18 at 11 43 32@2x

#!/usr/bin/env bash

function csi() {
  printf "\033[%s" "$*"
}

function osc() {
  printf "\033]%s\007" "$*"
}

rows=$(tput lines)
cols=$(tput cols)

csi "2J"
csi "1;1H"
csi "44m" # blue bg
csi "31m" # red fg
for ((j=1; j<=cols; j++)); do
  printf " "
done
csi "1;1H"

printf "\u2588"
printf "1"
printf "\u2588"
printf "fish"
printf "\u2588"
csi "0m"
printf "\n"
read

Fixes #2099

This is another heuristic of sorts to make `window-padding-color=extend`
look better by default. If a fully covering glyph is used then we use
the fg color to extend rather than the background.

This doesn't account for fonts that may do this for whatever codepoints,
but I think that's a special scenario that we should just recommend
disabling this feature.
@mitchellh mitchellh merged commit df9725a into main Aug 18, 2024
36 checks passed
@mitchellh mitchellh deleted the extend-covering branch August 18, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

U+2588 (full block) makes window-padding-color = extend awkward
1 participant