4303 Commits

Author SHA1 Message Date
Gregory Anders
47f8202334 termio: remove some code duplication in DECRQSS handler 2023-12-15 08:35:44 -06:00
Gregory Anders
08967f43e3 termio: use u2 for length 2023-12-15 08:05:32 -06:00
Chris Marchesi
5e7e3be60a build: use dedicated strings for conformance test keys
This uses separate strings for the keys for the conformance tests versus
just deriving them from the sliced path.

This fixed an issue for me where a few of the tests were showing up as
InvalidConformance (notably the "blocks" test), even though, oddly
enough, the key/value entries do appear to be there (e.g. if you iterated
over them). I did notice, though, that we currently sliced the key from
the file entry of the directory iterator, which is closed at the end of
conformanceSteps.
2023-12-14 21:35:04 -08:00
Gregory Anders
bf06c05c09 termio: implement DECRQSS
Only SGR, DECSCUSR, DECSTBM, and DECSLRM are handled, as these are the
only ones that Ghostty supports (as far as I can tell) and are the only
ones that seem actually useful.
2023-12-14 17:26:53 -06:00
Mitchell Hashimoto
05222b3ea8 Merge pull request #1093 from mitchellh/coretext-font-family
font/coretext: use `CTFontCopyFamilyName`
2023-12-14 14:00:19 -08:00
Kyaw
22d631942c font/coretext: use CTFontCopyFamilyName
Use `CTFontCopyFamilyName` instead of `CTFontCopyDisplayName` to get
the font name to match the behavior of how it's done on freetype
backend.
2023-12-15 02:26:47 +06:30
Mitchell Hashimoto
2cda1e0514 Merge pull request #1088 from mitchellh/kitty-mods
macos: proper event when sided mod released with other side pressed
2023-12-13 21:57:30 -08:00
Mitchell Hashimoto
9642dd3275 macos: proper event when sided mod released with other side pressed
Related to https://github.com/mitchellh/ghostty/issues/1082

This fixes two separate issues to follow along with the new spec changes
Kovid pushed to Kitty:

  1. When two modifiers are pressed and one is released, this shows up
     as a proper release event with the correct side. Previously, the
     correct side was shown but as a press event.

  2. When two modifiers are pressed and one is released, the Kitty event
     should not have that specific modifier set. For example, pressing
     left ctrl, then right ctrl, then releasing right ctrl should encode
     as "right ctrl released" but with NO modifiers still present.
2023-12-13 21:50:00 -08:00
Mitchell Hashimoto
9f7e53620b Merge pull request #1070 from mattrobenolt/overlay-color
Configurable unfocused dimming color
2023-12-13 19:10:22 -08:00
Mitchell Hashimoto
220da88a9a config: make unfocused-split-fill default to bg 2023-12-13 19:06:25 -08:00
Mitchell Hashimoto
4e0916d397 config: C API read allows any packed struct that fits in c int 2023-12-13 18:54:41 -08:00
Mitchell Hashimoto
6b94252da6 config: docs 2023-12-13 18:54:36 -08:00
Mitchell Hashimoto
5baab8f4f3 Merge pull request #1075 from rockorager/keypad
fix: keypad key encoding on GTK
2023-12-13 18:48:15 -08:00
Mitchell Hashimoto
89348fd73e include: add new keycodes 2023-12-13 18:46:55 -08:00
Mitchell Hashimoto
c905b08b1e apprt/gtk: slight stylistic change 2023-12-13 18:40:12 -08:00
Mitchell Hashimoto
18664b6fdf Merge pull request #1087 from mitchellh/close-quit
core: quit-after-last-window-closed works properly with "exit"
2023-12-13 16:36:45 -08:00
Mitchell Hashimoto
b021d76edf core: quit-after-last-window-closed works properly with "exit"
Fixes #1085

This moves the logic of exiting when there are no surfaces left fully to
apprt and away from the core.
2023-12-13 16:35:14 -08:00
Mitchell Hashimoto
2732ca9c5c os: passwd also gets username 2023-12-13 15:35:21 -08:00
Mitchell Hashimoto
cc6270f549 Merge pull request #1083 from gpanders/control-key-handling
macos: special case handling of some control keys
2023-12-13 13:50:06 -08:00
Mitchell Hashimoto
fefd4ca04d macos: style changes, make equivalent not an optional 2023-12-13 13:49:39 -08:00
Mitchell Hashimoto
54a5246ead Merge pull request #1084 from mitchellh/kitty-again
input/kitty: do not encode event with mods if press
2023-12-13 13:41:46 -08:00
Mitchell Hashimoto
5a372f6a06 input/kitty: do not encode event with mods if press
Fixes #1082
2023-12-13 13:39:44 -08:00
Gregory Anders
163ee1d75a macos: special case handling of some control keys
Some control key combinations must be handled specially by Ghostty to
prevent undesirable behavior at the OS level. For now, this includes
only Ctrl-/, which makes a "beep" sound when processed by AppKit. It is
unclear why this beep occurs and no answer was found after extensive
searching.

This solution is inspired by iTerm2, which also handles certain control
key combinations (including C-/) manually before passing them on to
Cocoa/AppKit.
2023-12-13 14:46:34 -06:00
Mitchell Hashimoto
8dba9f0cd6 Merge pull request #1081 from vancluever/vancluever-rect-select-fix-drag
Surface: fix some rectangle select behaviors
2023-12-13 12:12:08 -08:00
Mitchell Hashimoto
cfc4889572 Merge pull request #1077 from meatcar/gtk-tab-middleclick-close
gtk: close tabs with middle-click
2023-12-13 11:59:41 -08:00
Mitchell Hashimoto
63f2d3ff1a Merge pull request #1079 from mitchellh/unadjusted-box
font/sprite: manually determine which box codepoints are unadjusted
2023-12-13 11:07:15 -08:00
Mitchell Hashimoto
b3c685d385 Merge pull request #1080 from mitchellh/kitty
A couple Kitty keyboard fixes
2023-12-13 11:03:15 -08:00
Mitchell Hashimoto
c0eded766a input/kitty: do not encode event+mods if they're both default 2023-12-13 10:57:17 -08:00
Chris Marchesi
aeaf5ea467 Surface: fix some rectangle select behaviors
This fixes a couple of subtle rectangle select behaviors:

* Corrects how selection rolls over when crossing the x-boundary; this
  was mentioned in #1021, this properly corrects it so both sides of the
  x-boundary do not share characters.

* Corrects a minor quirk in the selection of initial cells in a
  selection - this can be more readily observed when selecting a single
  line with rectangle select. To correct this, we only use the x axis
  when calculating this instead of both x and y.
2023-12-13 10:51:17 -08:00
Mitchell Hashimoto
08e0d0b836 apprt/gtk: do not encode control characters into utf8 event field 2023-12-13 10:45:47 -08:00
Mitchell Hashimoto
b3522f548e confirmance: fix unused var warnings 2023-12-13 10:36:08 -08:00
Mitchell Hashimoto
85b40874cf font/sprite: manually determine which box codepoints are unadjusted
Some box codepoints (the cursor) want to use the original font metrics
height but others (corners) want to use the full grid height. I can't
see a better way to do this than manually maintaining a switch here. We
can add codepoints as needed.
2023-12-13 10:32:16 -08:00
Denys Pavlov
fc7013fc2e gtk: close tabs with middle-click
Follow the behaviour of other tabbed interfaces like browsers, editors,
and file-managers.

GTK code is based on `/src/apprt/gtk/ImguiWidget.zig`
2023-12-13 11:14:35 -05:00
Tim Culverhouse
4bd9b1365a key: add TODO's for media keys
Add TODO comments in places where we need to add media keys.
2023-12-13 06:57:15 -06:00
Tim Culverhouse
a0880bcfed key: add additional keypad keys
Add additional keypad keys to the encoding scheme. This allows Ghostty
to report KP_HOME and it's relatives. We also always check for a keyval
first, so we can report KP_7, etc as opposed to ASCII '7'.
2023-12-13 06:55:22 -06:00
Tim Culverhouse
eb8fc910e0 gtk: get num_lock state for key events
GTK doesn't expose the num_lock state via the key press event, this must
be obtained directly from the device. Set the num_lock state in the
modifier mask. This also will never show up as a `consumed_mod`, so we
don't bother setting it there.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2023-12-13 06:55:22 -06:00
Matt Robenolt
ae6645586e unpack rgb correctly 2023-12-12 21:56:35 -08:00
Mitchell Hashimoto
20dbe9792e Merge pull request #1072 from mitchellh/cell-height
`adjust-cell-height` adjustments
2023-12-12 20:59:48 -08:00
Mitchell Hashimoto
1c3948f4d7 Merge pull request #1062 from mitchellh/mrn/gtk-equalize-splits
gtk: implement equalize_splits
2023-12-12 20:59:33 -08:00
Mitchell Hashimoto
8fc0cdb220 font: cursor size remains original cell height if height adjusted
Fixes #1067
2023-12-12 20:43:11 -08:00
Thorsten Ball
47b0592c73 gtk: use f64 everywhere instead of i16/f16/c_int 2023-12-13 05:38:34 +01:00
Mitchell Hashimoto
dafc02e29c font: adjust cell baseline to center after modification, fix styles
Fixes #1064
Fixes #1066
2023-12-12 20:14:02 -08:00
Mitchell Hashimoto
6403ef1198 font/coretext: ceil the cell height and ascent metrics
Fixes #1068
2023-12-12 19:58:57 -08:00
Matt Robenolt
1b039b35ac typos 2023-12-12 17:22:37 -08:00
Matt Robenolt
3866e09210 Use packed struct 2023-12-12 17:20:42 -08:00
Matt Robenolt
91937c4ada Apply feedback 2023-12-12 17:14:47 -08:00
Matt Robenolt
8e607f372b Configurable unfocused dimming color 2023-12-12 16:34:41 -08:00
Mitchell Hashimoto
7c2ecfea90 Merge pull request #1061 from jcollie/nix-formatting
Use Alejandra to format Nix modules.
2023-12-12 14:31:26 -08:00
Jeffrey C. Ollie
33c2ffcdd1 Fix another spelling error. 2023-12-12 12:57:06 -06:00
Jeffrey C. Ollie
f076d6c958 Fix spelling error. 2023-12-12 12:38:39 -06:00