Open AlbertMarashi opened 1 week ago
The ideal approach would be to expose some kind of terminal.ansi.background
color's for the background
color, such that text rendered with it appears in that color instead of terminal.background
I have been able to debug the issue, it appears that vitest is using a specific ansi color code
echo -e "\033[7m\033[1m\033[36m RUN \033[39m\033[22m\033[27m"
This command will output:
\033[7m
: Enables reverse video (swaps foreground and background colors)\033[1m
: Enables bold text\033[36m
: Sets the text color to cyan\033[39m
: Resets the text color to default\033[22m
: Turns off bold\033[27m
: Turns off reverse videoI think it has something to do with the reverse video - it's putting terminal.background
(#0000
) as the terminal.foreground
equivalent - so when it prints, its appearing as invisible text inside of Zed's terminal
Is this a bug?
Additionally, pasted text into the terminal appears as white, presumably for the same "video reversal" reason
What is the right approach here?
#!/bin/bash
# Function to print colored text with reverse video
print_reverse_color() {
local color=$1
local color_name=$2
echo -e "\033[7m\033[1m\033[${color}m ${color_name} \033[39m\033[22m\033[27m"
}
# Print header
echo "Reverse Video ANSI Color Test"
echo "-----------------------------"
# Standard colors
print_reverse_color "30" "Black"
print_reverse_color "31" "Red"
print_reverse_color "32" "Green"
print_reverse_color "33" "Yellow"
print_reverse_color "34" "Blue"
print_reverse_color "35" "Magenta"
print_reverse_color "36" "Cyan"
print_reverse_color "37" "White"
echo
# Bright colors
print_reverse_color "90" "Bright Black"
print_reverse_color "91" "Bright Red"
print_reverse_color "92" "Bright Green"
print_reverse_color "93" "Bright Yellow"
print_reverse_color "94" "Bright Blue"
print_reverse_color "95" "Bright Magenta"
print_reverse_color "96" "Bright Cyan"
print_reverse_color "97" "Bright White"
echo
# Default color
echo -e "\033[7m\033[1m Default Color \033[22m\033[27m"
With terminal.background
set to #0000
With terminal.background
set to #000
After I spent some time thinking about it, I think the right approaches are either to:
#0000
becomes #000
and #FFF0
becomes #FFF
, but probably only in the context of "video reversal" mode?
Check for existing issues
Describe the feature
When using a
transparent
orblurred
theme, I wish to have a terminal that is transparent.Unfortunately, text using the "background" color in my terminal gets turned invisible.
The correct behavior should look like this
However, our terminal is turned dark and we can no longer see the blurred background effect in the theme
If applicable, add mockups / screenshots to help present your vision of the feature
No response