238 Commits

Author SHA1 Message Date
Mitchell Hashimoto
a908aca563 kittygfx: z-index handling fixes
Fixes #2921

Our z-index handling was pretty much completely broken, hence I can't
think of a better initial commit message. We were splitting the
placements at the wrong points and just generally putting images in the
wrong z-index. I'm shocked this didn't come up earlier.
2024-12-23 12:46:46 -08:00
Mitchell Hashimoto
f8a8b0464c renderer/opengl: fix memory leak when copying font features 2024-11-20 14:08:00 -08:00
Mitchell Hashimoto
72a3d22e69 apprt/gtk: use new size structs 2024-11-14 14:04:20 -08:00
Mitchell Hashimoto
3b856f6269 renderer/opengl: update to new size struct 2024-11-14 13:49:49 -08:00
Mitchell Hashimoto
aed51fd0b0 terminal: PageList rename "page" to "node" everywhere
This is more correct: a pagelist is a linked list of nodes, not pages.
The nodes themselves contain pages but we were previously calling the
nodes "pages" which was confusing, especially as I plan some future
changes to the way pages are stored.
2024-11-07 13:44:39 -08:00
Marijn Besseling
4496e7d314 implement overline decoration (SGR 53/55) 2024-10-21 08:36:08 -04:00
Qwerasd
0bb176d22c renderer: cleanup, reduce nesting, more comments 2024-10-09 15:53:02 -04:00
Qwerasd
7686cacde6 renderer, shaper: don't use null cells, handle bg and decorations separately
Significant rework that also removes a lot of unnecessarily duplicated
work while rebuilding cells in both renderers. Fixes multiple issues
with decorations and bg colors on wide chars and ligatures, while
reducing the amount of special case handling required.
2024-10-08 23:10:43 -04:00
Mitchell Hashimoto
89fadfc202 renderer: fg/bg/cursor change must mark the screen as dirty
Fixes #2372
2024-10-04 06:58:50 -10:00
Qwerasd
dfc0894d5d fix(renderer): make all decorations and combining marks visible under cursor
Metal needed to be changed to account for wide chars having decorations
on the right half and OpenGL needed to account for multiple glyphs being
under the cursor at once (decorations and combining marks) as well as
wide chars.
2024-10-02 17:18:26 -04:00
Qwerasd
f9e2cb6aec fix(renderer): use 1-wide ul/st chars, ignore null shaper cells
This makes sure that underline styles are consistent and not stretched,
and avoids rendering overlapping text decorations or extraneous
background cells for the right halves of wide chars.
2024-10-02 16:38:31 -04:00
Qwerasd
ecb3c543b3 renderer/OpenGL: use better logic for whether to render glyph
Metal already had this change made, so I copied it over from there. This
logic is more straightforward. Also copied the check to skip 0-sized
glyphs, since sometimes, for example, spaces are emitted as glyphs by
the shaper for some reason, even though they have no actual content, and
we want to avoid sending a bunch of useless stuff to the GPU.
2024-09-23 18:35:20 -06:00
Qwerasd
bf2794f90f renderer: draw underlines below text to improve legibility 2024-09-23 18:31:39 -06:00
Mitchell Hashimoto
5c469a0b44 renderer: render lock for password input 2024-09-18 11:14:37 -07:00
Gregory Anders
64abbd0ea6 config: move optional path parsing into RepeatablePath
This commit refactors RepeatablePath to contain a list of tagged unions
containing "optional" and "required" variants. Both variants have a null
terminated file path as their payload, but the tag dictates whether the
path must exist or not. This implemenation is used to force consumers to
handle the optional vs. required distinction.

This also moves the parsing of optional file paths into RepeatablePath's
parseCLI function. This allows the code to be better unit tested. Since
RepeatablePath no longer contains a simple list of RepeatableStrings,
many other of its methods needed to be reimplemented as well.

Because all of this functionality is built into the RepeatablePath type,
other config options which also use RepeatablePath gain the ability to
specify optional paths as well. Right now this is only the
"custom-shaders" option. The code paths in the renderer to load shader
files has been updated accordingly.

In the original optional config file parsing, the leading ? character
was removed when paths were expanded. Thus, when config files were
actually loaded recursively, they appeared to be regular (required)
config files and an error occurred if the file did not exist. **This
issue was not found during testing because the presence of the
"theme" option masks the error**. I am not sure why the presence of
"theme" does this, I did not dig into that.

Now because the "optional" or "required" state of each path is tracked
in the enum tag the "optional" status of the path is preserved after
being expanded to an absolute path.

Finally, this commit fixes a bug where missing "config-file" files were
not included in the +show-config command (i.e. if a user had
`config-file = foo.conf` and `foo.conf` did not exist, then `ghostty
+show-config` would only display `config-file =`). This bug applied to
`custom-shaders` too, where it has also been fixed.
2024-09-17 22:08:59 -05:00
Mitchell Hashimoto
cff907940f renderer: do not extend padding color if any cell has default bg color
Before, cells that were explicitly set to match the default bg color
were treated as if they did NOT have the default and extending would
occur. We now check the exact RGB of each cell.
2024-08-22 14:57:46 -07:00
Mitchell Hashimoto
2ee54879a4 renderer: use fg as extension color for covering glyphs (U+2588)
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.
2024-08-18 11:56:50 -07:00
Qwerasd
37872afbce kitty graphics: support loading 1 channel grayscale images 2024-08-15 21:38:46 -04:00
Mitchell Hashimoto
bc667714dd renderer/opengl: add comment explaning ogl lock on darwin 2024-08-15 14:25:05 -07:00
Qwerasd
57d850822e macos/opengl: lock context while rendering to stop resize crashes 2024-08-14 23:47:33 -04:00
Qwerasd
900aab10f2 renderer: don't update frame if renderer grid size != terminal size 2024-08-14 22:43:58 -04:00
Qwerasd
10b8ca3c69 spelling: normalize grey -> gray 2024-08-11 18:31:01 -04:00
Mitchell Hashimoto
f7f8c655df renderer: remove alt-screen extend-always 2024-08-10 10:39:10 -07:00
Mitchell Hashimoto
9f06e74353 config: add window-padding-color=extend-always to force always 2024-08-10 10:34:12 -07:00
Mitchell Hashimoto
e4b8cac7ad renderer/opengl: reset screen uniforms on font change
Fixes #2067
2024-08-09 10:26:46 -07:00
Mitchell Hashimoto
0f8ed39766 Merge pull request #2049 from pluiedev/fix/exempt-powerline-from-minimum-contrast
renderer: exempt Powerline cells from minimum contrast requirements
2024-08-06 10:12:14 -07:00
Leah Amelia Chen
503dfae6ff renderer: exempt Powerline cells from minimum contrast requirements
With a minimum contrast set, the colored glyphs that Powerline uses
would sometimes be set to white or black while the surrounding background
colors remain unchanged, breaking up contiguous colors on segments of
the Powerline.

This no longer happens with this patch as Powerline glyphs are now
special-cased and exempt from the minimum contrast adjustment.
2024-08-06 15:28:50 +08:00
Łukasz Niemier
f9be02a20f chore: clean up typos 2024-08-05 13:56:57 +02:00
Mitchell Hashimoto
ea551990eb 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.
2024-08-03 21:56:19 -07:00
Mitchell Hashimoto
ed1c163c7b renderer/opengl: support window-padding-color=extend 2024-08-03 16:29:17 -07:00
Mitchell Hashimoto
62cc279fc0 Merge pull request #1989 from gpanders/cursor-invert-fg-bg
config: add cursor-invert-fg-bg option
2024-07-31 19:39:27 -07:00
Mitchell Hashimoto
765254e784 renderer/opengl: unicode placeholder support 2024-07-29 19:15:42 -07:00
Mitchell Hashimoto
763e7fab8a renderer: skip virtual placements 2024-07-25 21:32:44 -07:00
Gregory Anders
3e4a8644b5 renderer/opengl: implement cursor-invert-fg-bg 2024-07-22 16:23:06 -05:00
Mitchell Hashimoto
af132a3838 Merge pull request #1872 from qwerasd205/various-performance
Various Performance Changes
2024-06-23 09:51:21 -07:00
Mitchell Hashimoto
71353d016e coretext shaper owns CFReleaseThread, works on both Metal and OpenGL now 2024-06-22 20:42:59 -07:00
Mitchell Hashimoto
4325dc51bc font: coretext shaper owns the cf release pool 2024-06-22 20:32:24 -07:00
Mitchell Hashimoto
6f43c01b76 renderer/opengl: invert cursor cell text when glyph is constrained
Fixes #1867
2024-06-18 14:59:49 -07:00
Qwerasd
3f3db4896b add CFReleasePool handling to OpenGL renderer 2024-06-14 02:07:17 -04:00
Mitchell Hashimoto
a502089582 renderer/opengl: don't append assume capacity
Fixes #1815
2024-06-03 20:55:11 -07:00
Jan200101
94a7166028 terminal: support using the bright palette for bold text 2024-05-25 16:58:19 +02:00
Mitchell Hashimoto
06bcbe868f renderer: kitty image with y offset should stretch image
Fixes #1784

This was just a misunderstanding of the "spec." When both a y offset
into the image is specified and a height, the image should be stretched.
I mistakingly thought that the image should be offset (even with this
misunderstanding there was a data corruption bug).

This resolves the issue and output matches Kitty.
2024-05-22 15:40:31 -04:00
Qwerasd
ac5725d582 fix(renderer): rebuild font grid and reset shaper cache on hot reload
When hot reloading config with a new font, shaper cache data needs to be
invalidated and the font grid needs to be rebuilt. This change just
makes that happen on all config reloads since it's a rare action so it's
not a performance concern.
2024-05-10 09:39:07 -07:00
Mitchell Hashimoto
8fdf6b4b64 renderer: add window-vsync option (defaults to false) 2024-05-05 10:18:15 -07:00
Mitchell Hashimoto
ac813c9244 renderer/metal: stop/start display link on occlusion 2024-05-04 14:49:50 -07:00
Mitchell Hashimoto
406824bcd4 renderer/opengl: use shaper cache 2024-05-01 19:43:48 -07:00
Mitchell Hashimoto
f7714a113d renderer/opengl: fix compilation 2024-04-28 09:40:03 -07:00
Mitchell Hashimoto
4398896905 renderer/opengl: strikethrough as sprite 2024-04-22 10:30:27 -07:00
Mitchell Hashimoto
06df9b7867 font: remove old files 2024-04-06 20:10:57 -07:00
Mitchell Hashimoto
e3402cef4d address many fontmem todos 2024-04-06 20:00:22 -07:00