mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-20 20:04:26 +00:00
renderer: disable window-padding-color=extend in certain scenarios
There are scenarios where this configuration looks bad. This commit
introduces some heuristics to prevent it. Here are the heuristics:
* Extension is always enabled on alt screen.
* Extension is disabled if a row contains any default bg color. The
thinking is that in this scenario, using the default bg color looks
just fine.
* Extension is disabled if a row is marked as a prompt (using semantic
prompt sequences). The thinking here is that prompts often contain
perfect fit glyphs such as Powerline glyphs and those look bad when
extended.
This introduces some CPU cost to the extension feature but it should be
minimal and respects dirty tracking. This is unfortunate but the feature
makes many terminal scenarios look much better and the performance cost
is minimal so I believe it is worth it.
Further heuristics are likely warranted but this should be a good
starting set.
This commit is contained in:
@@ -674,6 +674,17 @@ keybind: Keybinds = .{},
|
||||
/// * `background` - The background color specified in `background`.
|
||||
/// * `extend` - Extend the background color of the nearest grid cell.
|
||||
///
|
||||
/// The "extend" value will be disabled in certain scenarios. On primary
|
||||
/// screen applications (i.e. not something like Neovim), the color will not
|
||||
/// be extended vertically if any of the following are true:
|
||||
///
|
||||
/// * The nearest row has any cells that have the default backgroudn color.
|
||||
/// The thinking is that in this case, the default background color looks
|
||||
/// fine as a padding color.
|
||||
/// * The nearest row is a prompt row (requires shell integration). The
|
||||
/// thinking here is that prompts often contain powerline glyphs that
|
||||
/// do not look good extended.
|
||||
///
|
||||
/// The default value is "extend". This allows for smooth resizing of a
|
||||
/// terminal grid without having visible empty areas around the edge. The edge
|
||||
/// cells may appear slightly larger due to the extension.
|
||||
|
||||
Reference in New Issue
Block a user