Skip to content

Blend the semi-transparent background color of the scrollback rows with the global background color (and fix OSC 11 behavior)#882

Merged
o-sdn-o merged 4 commits intodirectvt:masterfrom
o-sdn-o:gui-bridge
Feb 27, 2026
Merged

Conversation

@o-sdn-o
Copy link
Collaborator

@o-sdn-o o-sdn-o commented Feb 27, 2026

Changes

  • Implement new transparency support logic for the built-in terminal:
    • Store an alpha channel for colors:
      • Foreground of each scrollback cell (SGR 38:2::R:G:B:A, A=255 by default)
      • Background of each scrollback cell (SGR 48:2::R:G:B:A, A=255 by default)
    • Inherit the foreground alpha for underline colors (set by SGR 58:2::R:G:B).
    • Handle the terminal window rendering by:
      • Blending the semi-transparent background color of the scrollback rows with the global background color (set by OSC 11).
      • Blending the semi-transparent foreground (and underline) color of the scrollback rows with the final background color calculated in the previous step.

An example of using color brushes that are independent of the global background:

printf "\e[m
 \e[35b\n  \e[48:2::0:0:255:128m Some Text Fragment \e[m  
 \e[35b\n  \e[48:2::0:255:0:128m Some Text Fragment \e[m  
 \e[35b\n  \e[48:2::255:0:0:128m Some Text Fragment \e[m  
 \e[35b\n  \e[48:2::0:255:255:128m Some Text Fragment \e[m  
 \e[35b\n  \e[48:2::255:255:0:128m Some Text Fragment \e[m  
 \e[35b\n  \e[48:2::255:0:255:128m Some Text Fragment \e[m  
 \e[36b\n"

@o-sdn-o o-sdn-o merged commit 89a9eab into directvt:master Feb 27, 2026
9 checks passed
@o-sdn-o o-sdn-o deleted the gui-bridge branch February 27, 2026 23: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.

1 participant