448 Commits

Author SHA1 Message Date
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
Mitchell Hashimoto
a62b76eda3 core: add binding to write screen to file 2024-07-19 20:24:51 -07:00
Mitchell Hashimoto
55657465a7 add write_selection_file
Based on the work by @gigamaax
2024-07-19 20:20:49 -07:00
Mitchell Hashimoto
10198d88dc core: make the write scrollback file logic more generic 2024-07-19 20:16:17 -07:00
Mitchell Hashimoto
e3df08039a some bikeshedding 2024-07-19 20:03:20 -07:00
karei
6fde429728 core: support opening scrollback file in default text editor 2024-07-19 19:56:00 -07:00
Mitchell Hashimoto
72c0f9dd32 adjust selection 2024-07-19 14:20:28 -07:00
Mitchell Hashimoto
72d8af5d0b rename to expand_selection 2024-07-19 14:19:21 -07:00
Cameron Dart
cdeeeb9f88 feat: keybinds for text selection on copy mode 2024-07-19 14:08:52 -07:00
Mitchell Hashimoto
2d7baaa7d7 apprt/gtk: toggle_window_decorations keybinding
Fixes #1943
2024-07-15 21:23:52 -07:00
Mitchell Hashimoto
835d622baa termio: writer => mailbox 2024-07-15 10:23:09 -07:00
Mitchell Hashimoto
001a6d2624 termio: reader => backend 2024-07-15 10:14:14 -07:00
Mitchell Hashimoto
dc6dc1d3d2 termio: remove more state 2024-07-15 10:02:02 -07:00
Mitchell Hashimoto
3625e1e58e termio: take reader as option 2024-07-15 09:55:31 -07:00
Mitchell Hashimoto
a848a53d26 termio: remove a ton of state 2024-07-14 15:10:05 -07:00
Mitchell Hashimoto
af7adedb50 termio: writer abstraction 2024-07-14 14:48:48 -07:00
Mitchell Hashimoto
31144da845 termio: Thread doesn't need to hold termio pointer 2024-07-14 10:27:58 -07:00
Mitchell Hashimoto
49c92fd0e6 termio: rename Exec to Termio throughout 2024-07-13 15:19:37 -07:00
Alexey Shekhirin
447c324c4d docs(surface): keyCallback return value is self-descriptive 2024-07-11 20:24:09 +01:00
Qwerasd
94f50be0fe Disable mouse scroll logging since it floods logs when trackpad scrolling 2024-07-08 22:16:13 -04:00
Mitchell Hashimoto
31d5384920 macOS select output is cmd+tripleclick not control anymore
Fixes #1920

Ctrl interferes with context menus.
2024-07-07 14:01:20 -07:00
Mitchell Hashimoto
a32007bfeb core: when mouse reporting, clear link state 2024-07-07 12:26:40 -07:00
Mitchell Hashimoto
c9accc52e2 core: show URL even for non-OSC8 hyperlnks 2024-07-06 21:36:28 -07:00
Mitchell Hashimoto
8ecc84b943 core: helper to get osc8 URI 2024-07-06 10:27:21 -07:00
Mitchell Hashimoto
cb790b8e39 macos: show URL on OSC8 hover 2024-07-06 10:25:12 -07:00
Mitchell Hashimoto
e8a8b189ba core: when over a link we must set the whole screen dirty on move 2024-07-05 21:40:39 -07:00
Mitchell Hashimoto
925ad5b45c renderer: match multiple lines for osc8 2024-07-05 21:40:39 -07:00
Mitchell Hashimoto
f8fe0445a5 core: clicking OSC8 links work 2024-07-05 21:40:39 -07:00
Mitchell Hashimoto
3462b0676d core: mouse shift escape applies to all buttons, not just left
Fixes #1905
2024-07-01 18:42:32 -07:00
Mitchell Hashimoto
7fbc73ad37 macos: implement ctrl+command+d for quicklook under cursor 2024-07-01 10:08:38 -07:00
Mitchell Hashimoto
57d71450ab ctrl+click is handled as right-click (with various details)
If mouse capturing is enabled, we encode ctrl+click as ctrl+left-click
and DO NOT handle it as right click.
2024-06-30 19:44:51 -07:00
Mitchell Hashimoto
32588a647f core: on right click, only create selection if point isn't in prev sel 2024-06-30 10:24:53 -07:00
Mitchell Hashimoto
a586eb9889 core: right-click press selects word 2024-06-30 10:22:34 -07:00
Mitchell Hashimoto
03f37087a5 mouse button callbacks returns bool for consumption 2024-06-30 09:42:15 -07:00