2837 Commits

Author SHA1 Message Date
Mitchell Hashimoto
0e8412ec19 terminal: add w3c luminance formula 2023-08-30 10:10:45 -07:00
Mitchell Hashimoto
3391908a82 terminal: get rid of duplicate RGB struct 2023-08-30 08:48:57 -07:00
Mitchell Hashimoto
e2fae7ab2b surface should default to default cursor, blinking should check selected 2023-08-30 08:12:38 -07:00
Mitchell Hashimoto
e9f94bab21 Merge pull request #360 from mitchellh/tabstops
terminal: tabstops were off by one
2023-08-29 20:36:22 -07:00
Mitchell Hashimoto
7e846bd367 terminal: tabstops were off by one
Fixes #359

See #359 for a test script. The unit tests were also wrong. I used the
test script in #359 to verify the exact column that tabstops should be
set at.
2023-08-29 20:18:54 -07:00
Mitchell Hashimoto
5583859332 Merge pull request #358 from mitchellh/lig-flash
Ligature shaping fixes
2023-08-29 14:16:15 -07:00
Mitchell Hashimoto
ed5c001690 font/shaper: split ligature around cell style change 2023-08-29 14:09:21 -07:00
Mitchell Hashimoto
ae0de7bce4 renderer: split ligature around cursor even if cursor is flashing
Fixes #356
2023-08-29 13:49:14 -07:00
Mitchell Hashimoto
2ad9f76749 Merge pull request #355 from mitchellh/box-cras
font/sprite: fix horizontal dash drawing math for cells too small
2023-08-29 11:32:56 -07:00
Mitchell Hashimoto
4ed240515c font/sprite: fix horizontal dash drawing math for cells too small
Fixes #143

There were multiple issues with the previous calculation. First, we
expected dash width COULD be negative and protected against it, but our
dash width calculation type was unsigned! With the proper font metrics,
this led to an underflow safey panic.

Second, as part of the dash width calculation, we are tryign to downstep
the size of the gaps so we can try to fit dashes within a cell. But we
were not using those adjusted gap sizes. With the proper font metrics,
this could lead to an assertion failure seen in #143.

This fixes the calculations. They produce the same numbers, but do so in
a more Zig-idiomatic way while fixing the above two issues.
2023-08-29 11:25:49 -07:00
Mitchell Hashimoto
a8dc663bd7 Merge pull request #350 from moderation/main
vendor: update zlib
2023-08-28 14:19:37 -07:00
moderation
0f4202c7f1 vendor: update zlib
Signed-off-by: moderation <michael@sooper.org>
2023-08-28 13:20:06 -07:00
Mitchell Hashimoto
0204d94921 Merge pull request #349 from mitchellh/sync
Synchronized Output Sequence
2023-08-28 13:15:50 -07:00
Mitchell Hashimoto
0feac5d6cf termio/exec: disable synchronized output mode on resize 2023-08-28 11:43:28 -07:00
Mitchell Hashimoto
5168dc7645 renderer: do not render if synchronized output is on 2023-08-28 11:38:11 -07:00
Mitchell Hashimoto
2cc1e43716 termio: handle all the synchronized output setting, timer 2023-08-28 11:35:40 -07:00
Mitchell Hashimoto
91c2d6fcbd Merge pull request #348 from mitchellh/cc-term_program_env
Set TERM_PROGRAM and TERM_PROGRAM_VERSION environment variables
2023-08-28 11:34:08 -07:00
cryptocode
bdafd2dc8b Add comment explaining the purpose of the env variables 2023-08-28 20:25:44 +02:00
cryptocode
dfe21dcac4 Set TERM_PROGRAM and TERM_PROGRAM_VERSION environment variables.
WezTerm claims this is an emerging de-facto standard for terminal emulator identification:
a103b6d97a/config/src/config.rs (L1526-L1529)

One example of usage in the wild is neovim doing capability detection:
f050aaabbb/src/nvim/tui/tui.c (L206-L211)

Ghostty now reports this:

$echo $TERM_PROGRAM
ghostty

$echo $TERM_PROGRAM_VERSION
0.1.0-main+aa08f3c

I think it's really nice that the commit hash is included, as users can provide this in issue reports. WezTerm does the same.

I use these variables in my tui library in addition to $TERM and $COLORTERM for capability detection, which is what motivated this PR.
2023-08-28 20:16:46 +02:00
Mitchell Hashimoto
8ad98bb9ca Merge pull request #347 from mitchellh/cursor-style
Add option for custom cursor style
2023-08-28 10:44:56 -07:00
SoraTenshi
ead70eadae Add Caveat information for shell integration 2023-08-28 19:44:01 +02:00
SoraTenshi
fcf1537f82 config: Add option for custom cursor style 2023-08-28 18:20:45 +02:00
Mitchell Hashimoto
3b9d5d27ad terminal: implement DECRQM (request mode) 2023-08-28 08:50:11 -07:00
Mitchell Hashimoto
cbfa22555e terminal: test to ensure that DECRQM can parse 2023-08-28 08:36:00 -07:00
Mitchell Hashimoto
aa08f3cd6b Merge pull request #346 from mitchellh/combining-resize
Resize with less cols (reflow or not) preserves zero-width codepoints
2023-08-28 08:24:22 -07:00
Mitchell Hashimoto
be27b825f3 terminal: resize with less cols preserves zero width codepoints 2023-08-28 08:18:03 -07:00
Mitchell Hashimoto
c243c9d72e terminal: screen test dumpString function should add graphemes 2023-08-28 08:07:40 -07:00
Mitchell Hashimoto
83959cd058 Merge pull request #345 from mitchellh/variable-fonts
Variable font support
2023-08-28 07:35:19 -07:00
Mitchell Hashimoto
b61541cc3f Merge pull request #344 from mitchellh/psth/gtk-switch-page
use Gtk.Notebook::switch-page callback for setting window title
2023-08-28 07:34:41 -07:00
Seth Rider
c56d07c36f use Gtk.Notebook::switch-page callback for setting window title 2023-08-28 07:26:30 -07:00
Mitchell Hashimoto
ae3892995a Merge pull request #342 from mitchellh/goonz/non-native-fullscreen-fixes
macos: fix non-native fullscreen dock/menubar bugs
2023-08-28 07:25:51 -07:00
Mitchell Hashimoto
1ee5b7f91c font: freetype supports font variation settings 2023-08-28 07:25:09 -07:00
Mitchell Hashimoto
906852976b config: new "font-variation" set of configurations to set variable font 2023-08-28 07:25:09 -07:00
Mitchell Hashimoto
16808f2b35 font/coretext: log the variation axes in debug mode 2023-08-28 07:25:09 -07:00
Mitchell Hashimoto
9d0729f17c font/coretext: ability to set variation axes 2023-08-28 07:25:09 -07:00
Mitchell Hashimoto
fb0f80f9ca macos: add necessary functions for variation axes querying 2023-08-28 07:25:09 -07:00
Mitchell Hashimoto
decdf49a2b add pixman vendor without submodule 2023-08-28 07:24:12 -07:00
Mitchell Hashimoto
220e5b1818 remove pixman submodule 2023-08-28 07:22:18 -07:00
Will Pragnell
55d5350a65 macos: fix non-native fullscreen dock/menubar bugs 2023-08-26 19:35:19 -07:00
Mitchell Hashimoto
f733e58dc4 font/shaper: on macos load apple color emoji for tests 2023-08-26 17:14:22 -07:00
Mitchell Hashimoto
fc3ca689af Merge pull request #341 from mitchellh/psth/gtk-window-title
Set gtk window title on change and tab swap (by key command)
2023-08-26 16:54:27 -07:00
Seth Rider
fc774cf21a Set gtk window title on change and tab swap (by key command) 2023-08-26 21:25:54 +01:00
Mitchell Hashimoto
928f12b5c1 Merge pull request #339 from mitchellh/combining
font: grapheme clusters need to find a single font for all codepoints
2023-08-26 09:41:45 -07:00
Mitchell Hashimoto
14c9279c21 config: add doc comment for cursor-text 2023-08-26 09:39:25 -07:00
Mitchell Hashimoto
71fddcdc89 Merge pull request #329 from hovsater/cursor-colors
Implement cursor text color option
2023-08-26 09:38:35 -07:00
Mitchell Hashimoto
e6edf3105e font: grapheme clusters need to find a single font for all codepoints
When font shaping grapheme clusters, we erroneously used the font index
of a font that only matches the first codepoint in the cell. This led to the
combining characters being [usually] unknown and rendering as boxes.

For a grapheme, we must find a font face that has a glyph for _all codepoints_
in the grapheme.

This also fixes an issue where we now properly render the unicode replacement
character if we can't find a font satisfying a codepoint.
2023-08-26 09:35:56 -07:00
Mitchell Hashimoto
39c2332d35 input: keypad enter should act as normal "\r" if no other seq matches
This matches Kitty behavior on both macOS and Linux. In certain keyboard
modes and Kitty keyboard modes, the behavior changes but those already
matched (tested).
2023-08-26 07:43:22 -07:00
Kevin Hovsäter
8b9a11db4b Implement cursor text in addition to color 2023-08-26 15:29:48 +02:00
Mitchell Hashimoto
73ff43590c Merge pull request #335 from mitchellh/null-focus
core: set focused surface pointer to null if matches on delete
2023-08-25 21:08:16 -07:00
Mitchell Hashimoto
6a8d302fa0 core: set focused surface pointer to null if matches on delete
We previously never set the focused pointer to null. I thought this
would be fine because a `hasSurface` check would say it doesn't exist.
But I didn't account for the fact that a deleted surface followed very
quickly by a new surface would free the pointer, then the allocation
would reuse the very same pointer, making `hasSurface` return a false
positive.

Well, technically, hasSurface is not wrong, the surface exists, but its
not really the same surface, its just a surface that happens to have the
same pointer as a previously freed surface.

Co-authored-by: Will Pragnell <wpragnell@gmail.com>
2023-08-25 21:01:12 -07:00