531 Commits

Author SHA1 Message Date
Mitchell Hashimoto
26cba70b69 core: no need for hasTabs apprt function 2024-09-26 08:34:20 -07:00
Mitchell Hashimoto
02d7e766e1 core: move password input into action enum 2024-09-25 11:43:48 -07:00
Mitchell Hashimoto
1b31663865 apprt/embedded: new_window can be called without a parent 2024-09-24 18:33:10 -07:00
Mitchell Hashimoto
1ad904478d Tap events, core API to handle global keybinds 2024-09-24 16:29:02 -07:00
Mitchell Hashimoto
17caeb5fac core: "all" bindings work 2024-09-23 19:21:23 -07:00
Mitchell Hashimoto
7f8c1a37ff core: handle app bindings in the App struct 2024-09-23 19:08:23 -07:00
Mitchell Hashimoto
66143a33ef input: move flags to a packed struct 2024-09-23 14:03:53 -07:00
Mitchell Hashimoto
261ce00552 apprt/macos,gtk: unfocused splits now highlight hovered links
Fixes #1547

The core change to make this work is to make the cursor position
callback support taking updated modifiers. On both macOS and GTK, cursor
position events also provide the pressed modifiers so we can pass those
in.
2024-09-21 15:16:14 -07:00
Mitchell Hashimoto
1ed1c73c1a macos: enable secure input on password input 2024-09-19 16:38:32 -07:00
Mitchell Hashimoto
c0e0eff468 core: add toggle_secure_input keybinding 2024-09-19 10:20:30 -07:00
Mitchell Hashimoto
e3d528cf0b termio: use surface messages to trigger password input state 2024-09-18 21:14:05 -07:00
Mitchell Hashimoto
e8bbc987e0 termio: stop the termios poller when not focused 2024-09-18 11:56:07 -07:00
Jeffrey C. Ollie
5f759a19d1 GTK: Fix clicking on desktop notifications
Currently, clicking on a desktop notification will bring Ghostty
to the foreground, but it won't necessarily bring the right window
to the top and it won't switch tabs or change the focus on splits.

With this patch, clicking on a desktop notification will raise the
correct window, change to the correct tab, and focus on the correct
split that send the original desktop notification.
2024-09-13 13:37:38 -07:00
Jeffrey C. Ollie
f1473a1464 fix: Surface.selectionString should return sentinel slice
The underlying API call returns a sentinel slice so selectionString
should do the same or there are problems later trying to free the
allocated memory.
2024-09-10 17:22:29 -05:00
Gregory Anders
df06697899 termio: send initial focus reports
When the focus reporting mode (1004) is enabled, send the current focus
state. This allows applications to track their own focus state without
first having to wait for a focus event (or query
it by sending a DECSET followed by a DECRST).

Ghostty's focus state is stored only in the renderer, where the termio
thread cannot access it. We duplicate the focus state tracking in the
Terminal struct with the addition of a new (1-bit) flag. We duplicate
the state because the renderer uses the focus state for its own purposes
(in particular, the Metal renderer uses the focus state to manage
its DisplayLink), and synchronizing access to the shared terminal state
is more cumbersome than simply tracking the focus state in the renderer
in addition to the terminal.
2024-09-04 22:13:52 -05:00
Mitchell Hashimoto
8f5eea6bf8 core: set crash state in surface in various places 2024-09-02 10:30:09 -07:00
Mitchell Hashimoto
d499f7795b input: crash binding can configure which thread to crash 2024-09-02 09:44:35 -07:00
Mitchell Hashimoto
49e56a9057 input: add crash binding action, remove key input crash 2024-08-31 20:19:06 -07:00
Mitchell Hashimoto
d66178718c pkg/sentry: build in unwinder 2024-08-28 21:43:18 -07:00
Mitchell Hashimoto
80327402b8 Merge pull request #2120 from edmz/last_tab
macos: jump to last_tab
2024-08-26 20:22:52 -07:00
Mitchell Hashimoto
3d1ee3daa8 apprt: make gotoTab handle all tab movements 2024-08-26 20:13:27 -07:00
Mitchell Hashimoto
a3247366fb font/coretext: font-thicken renders with additional padding on context
At certain font sizes, this avoids clipping the text. This is due to a
limitation of the CoreText API, which does not provide a way to measure
the exact size of the text that will be rendered when antialiasing is
enabled.
2024-08-19 20:47:39 -07:00
Mitchell Hashimoto
295ef384a6 core: centralize key sequence ending in one function 2024-08-19 12:41:33 -07:00
Mitchell Hashimoto
99b3e2e844 core: clear pending keyboard sequence when config reloads 2024-08-19 12:33:29 -07:00
Mitchell Hashimoto
454c585eb3 core: handle unconsumed key sequences 2024-08-19 12:28:00 -07:00
Mitchell Hashimoto
4ce7a88dee core: enable key sequence handling, including dumping invalid 2024-08-19 12:22:52 -07:00
Mitchell Hashimoto
3a952de272 core: encodeKey should return a write request 2024-08-19 12:14:29 -07:00
Mitchell Hashimoto
08ba00246b core: release events should never trigger bindings 2024-08-19 12:04:09 -07:00
Eduardo Dominguez
262902a28d macos: jump to last_tab 2024-08-19 12:19:00 -06:00
Mitchell Hashimoto
203e33c416 core: move key handling (w/o bindings) out to a separate func
This is going to let us have a central place we can encode all the
inputs up to an invalid binding.
2024-08-19 10:54:02 -07:00
Mitchell Hashimoto
4201a580f3 core: rework binding handling to prepare for nested binding sets 2024-08-19 10:41:37 -07:00
Mitchell Hashimoto
9577c8b8b9 core: log when we see a leader 2024-08-18 20:30:32 -07:00
Mitchell Hashimoto
2bf20ec32c fix compilation but logic broken 2024-08-18 20:30:32 -07:00
Mitchell Hashimoto
b65a804bb2 almost yeeted it all! 2024-08-16 14:42:32 -07:00
Qwerasd
7929e0bc09 fix: prevent flicker while shrinking screen by eliminating thread race
Before this fix, if vsync was on the GPU cells buffer could be cleared
for a frame while resizing the terminal down. This was due to the fact
that the surface sent messages for the resize to both the renderer and
the IO thread. If the renderer thread was processed first then the GPU
cells buffer(s) would be cleared and not rebuilt, because the terminal
state would be larger than the GPU cell buffers causing updateFrame to
bail out early, leaving empty cell buffers.

This fixes the problem by changing the origin of the renderer's resize
message to be the IO thread, only after properly updating the terminal
state, to avoid clearing the GPU cells buffers at a time they can't be
successfully rebuilt.
2024-08-14 19:46:24 -04:00
Tim Culverhouse
97db055b54 fix(surface): account for padding in mouse pixel reports
Padding was accounted for in cell reports, but not pixel reports. Update
inspector to report the pixel coordinates the terminal reports.
2024-08-11 17:47:21 -05:00
Mitchell Hashimoto
ccf62a4960 stylistic nitpicks 2024-08-10 11:03:56 -07:00
Jeffrey C. Ollie
ce5e55d4aa Implement the XTWINOPS (CSI t) control sequences that "make sense".
These sequences were implemented:

CSI 14 t - report the text area size in pixels
CSI 16 t - report the cell size in pixels
CSI 18 t - report the text area size in cells
CSI 21 t - report the window title

These sequences were not implemented because they manuipulate the window
state in ways that we do not want.

CSI 1 t
CSI 2 t
CSI 3 ; x ; y t
CSI 4 ; height ; width ; t
CSI 5 t
CSI 6 t
CSI 7 t
CSI 8 ; height ; width ; t
CSI 9 ; 0 t
CSI 9 ; 1 t
CSI 9 ; 2 t
CSI 9 ; 3 t
CSI 10 ; 0 t
CSI 10 ; 1 t
CSI 10 ; 2 t
CSI 24 t

These sequences were not implemented because they do not make sense in
a Wayland context:

CSI 11 t
CSI 13 t
CSI 14 ; 2 t

These sequences were not implemented because they provide information
about the screen that is unnecessary.

CSI 15 t
CSI 19 t

These sequences were not implemeted because Ghostty does not maintain an
icon title for windows.

CSI 20 t
CSI 22 ; 0 t
CSI 22 ; 1 t
CSI 23 ; 0 t
CSI 23 ; 1 t

These sequences were not implemented because of the additional
complexity of maintaining a stack of window titles.

CSI 22 ; 2 t
CSI 23 ; 2 t
2024-08-07 00:12:20 -05:00
Mitchell Hashimoto
1e7672deba Merge pull request #2034 from jcollie/asymmetric-window-padding
Implement asymmetric window padding.
2024-08-05 15:56:15 -07:00
Mitchell Hashimoto
c2778ab3a6 config: window-padding-x/y take two values for uneven padding 2024-08-05 15:51:42 -07:00
Łukasz Niemier
f9be02a20f chore: clean up typos 2024-08-05 13:56:57 +02:00
Jeffrey C. Ollie
0f27fc2a0d Implement asymmetric window padding.
Add `window-padding-top`, `window-padding-bottom`,
`window-padding-left`, and `window-padding-right` options. The
`window-padding-x` and `window-padding-y` options will override the
individual options.
2024-08-03 14:42:28 -05:00
Mitchell Hashimoto
918a32dcf7 core: surface needs to free link regex on config reload 2024-08-01 09:41:48 -07:00
Mitchell Hashimoto
ad6a5e7aef core: avoid mouse report when mods change without mouse event
Fixes #2018

We should avoid mouse reports when we have a key event without an
associated mouse event (button or move). This is how xterm behaves and
we should match it.

Our approach to doing this is very hacky so I commented why and we can
hopefully clean all this up in the future.
2024-07-31 21:30:02 -07:00
Mitchell Hashimoto
d37c529308 update comments 2024-07-31 19:30:27 -07:00
Justin Su
32961d3e97 Use Surface.hasSelection() 2024-07-28 19:43:36 -04:00
Mitchell Hashimoto
cb9e7ab548 adjust_selection keybind should not be consumed if no selection 2024-07-27 21:32:52 -07:00
Mitchell Hashimoto
a75ee29f2d Merge pull request #1981 from injust/adjust-line
Add `adjust_selection` actions for `beginning_of_line` and `end_of_line`
2024-07-22 09:40:45 -07:00
multifred
72c672adb7 Fix multiple deprecated names for zig lib/std 2024-07-22 00:07:17 +02:00
Justin Su
97bd46de7f Add adjust_selection actions for beginning_of_line and end_of_line 2024-07-20 23:06:47 -04:00