448 Commits

Author SHA1 Message Date
Mitchell Hashimoto
3e247baef7 core: write scrollback file works again 2024-03-22 20:28:00 -07:00
Mitchell Hashimoto
1cdeacea34 core: remove incorrect std.meta.eql on selection 2024-03-22 20:28:00 -07:00
Mitchell Hashimoto
e018059a5d core: re-enable click to move cursor 2024-03-22 20:28:00 -07:00
Mitchell Hashimoto
6de661b9d1 core: remove completed todos 2024-03-22 20:27:56 -07:00
Mitchell Hashimoto
edc0864f32 core: drag triple click 2024-03-22 20:27:56 -07:00
Mitchell Hashimoto
4d0f210025 core: double-click drag 2024-03-22 20:27:56 -07:00
Mitchell Hashimoto
361fdd2179 core: checkResetSelSwitch converted 2024-03-22 20:27:55 -07:00
Mitchell Hashimoto
4254dc9eef core: single click selection is on the way 2024-03-22 20:27:55 -07:00
Mitchell Hashimoto
8ccc30da10 core: surface now tracks left click pin 2024-03-22 20:27:55 -07:00
Mitchell Hashimoto
21f09a9159 remove point.Viewport 2024-03-22 20:27:52 -07:00
Mitchell Hashimoto
d966e74f45 core: surface compiles 2024-03-22 20:27:44 -07:00
Mitchell Hashimoto
9b4ab0e209 zig build test with renamed terminal package 2024-03-22 20:27:44 -07:00
Mitchell Hashimoto
c86ae79d52 core: reset left click count if mouse reporting goes on 2024-03-20 15:58:16 -07:00
Tim Culverhouse
806b33f8f2 mouse: handle switch case '0' for left_click_count
A state of '0' if a valid state for the mouse click. I'm unsure *how* we
get a 0 within this branch but I was able to reliably trigger it while
clicking and dragging. We handle the state explicitly because the `else`
prong is `unreachable`. We only handle triple clicks, and in another
function we reset to 3 if the count goes above that. Add an assert to
confirm this is the case.
2024-03-20 10:57:52 -05:00
Mitchell Hashimoto
08f88a0c86 core: remove undefined access on variable
It was possible if there was no selection for `reset` to be undefined.
2024-03-10 17:29:54 -07:00
ProfOak
96daf97d19 Add keybind support for shift+insert selection paste 2024-02-21 19:33:05 -06:00
Mitchell Hashimoto
e1908f7cc7 renderer: handle renderer pause/redraw on occlusion 2024-02-13 09:21:04 -08:00
Mitchell Hashimoto
e95b1707c1 core: fallback to heap allocation for long preedit inputs
Fixes #1514

We previously required all preedit inputs to fit into the small copied
message size. That's true for 99% of all inputs, but if a long pre-edit
input comes in, this may not be true. We should try the small array
fast-path but fall back to heap allocation if we must.
2024-02-12 21:21:35 -08:00
Mitchell Hashimoto
be0595d71d apprt/embedded: add occlusion state callback 2024-02-12 13:48:09 -08:00
Erlend Lind Madsen
928d338c2b preeditCallback(self): remove fast path codepoint width 2024-02-09 21:44:54 +01:00
Erlend Lind Madsen
cf0d498e75 replace ziglyph codePointWidth -> table.get 2024-02-09 20:04:51 +01:00
Mitchell Hashimoto
f414787779 move SplitDirection to apprt 2024-02-04 20:42:42 -08:00
Tim Culverhouse
1824a0fe87 split: add auto as split option
Add an `auto` split direction which splits along the larger direction.
2024-02-04 21:28:17 -06:00
Krzysztof Wolicki
3959364a86 Surface: fix reportColorScheme on Windows 2024-02-03 13:08:05 +01:00
Mitchell Hashimoto
6fe8376073 terminal: support mode 2031 2024-02-02 13:08:10 -08:00
Mitchell Hashimoto
258d51395c apprt/embedded: add API for reporting color scheme 2024-02-02 13:02:16 -08:00
Mitchell Hashimoto
ae8f5f3ceb core: colorSchemeCallback on surface, can report 2024-02-02 12:51:20 -08:00
Mitchell Hashimoto
88e7c96eac Merge pull request #1431 from mitchellh/mouse-mods-alt
core: handle mouse capture events with link highlighting
2024-02-01 09:20:04 -08:00
Mitchell Hashimoto
6de4533afb core: handle mouse capture events with link highlighting
Fixes #1416

At a high level, the issue is that when mouse capture is enabled (i.e. in
neovim), "shift" escapes the capture. So "cmd+shift" is equal to "cmd"
which doesn't get sent to the TUI program and so on. For link
highlighting which now requires "cmd" (super) is held, we were sending
"cmd+shift" to the renderer so we weren't checking for links.

So the core of this commit is respecting this scenario and stripping the
shift modifier.

This commit also found that when the mouse wasn't over a link, we were
always checking and highlighting links on line one of the visible
screen. This bug is fixed and should also result in a very slight
performance improvement on rendering in all cases.
2024-02-01 09:19:39 -08:00
Mitchell Hashimoto
eafc9559d7 core: add "reset" keybinding to reset the terminal
Fixes #1425
2024-02-01 08:46:39 -08:00
Mitchell Hashimoto
0e46783a5d Merge pull request #1388 from mitchellh/macos-mods
core: send key release events on focus loss
2024-01-28 13:51:29 -08:00
Mitchell Hashimoto
06ff385e0c Merge pull request #1394 from em-dash/configure-scroll-speed
Configure scroll speed  #1378
2024-01-27 21:24:05 -08:00
Mitchell Hashimoto
5095c8f477 core: be explicit about float rounding for mouse scroll multiplier 2024-01-27 21:14:42 -08:00
Mitchell Hashimoto
3efe88c85c input: add link highlight always/hover w/ mods 2024-01-27 19:07:49 -08:00
Mitchell Hashimoto
ae11cc9042 add a new highlight state that requires modifiers 2024-01-27 19:03:03 -08:00
em-dash
ce7ba52b12 Add mouse-scroll-multiplier config option 2024-01-28 11:08:41 +11:00
Mitchell Hashimoto
1f4c8f3aa5 core: send key release events on focus loss
Related to #1284

This is highly GUI toolkit specific, but it is impossible to receive
events for some key releases when focus is lost while the keys are still
behind held. This commit always sends a release event for the last
pressed key when focus is lost, including each individual modifier.

On macOS, AppKit sends a key release event to a view if a prior press
event was sent, but only for non-modifier keys. This means that with
this commit (1) the full key release event is repeated but (2) modifier
release events are now properly sent.

On Linux with GTK, GTK sends modifier release events but not key release
events. This means that the behavior is inverted from macOS!

The result of this commit is that key release events _may be repeated_
on focus loss, but it ensures that all prior key+modifiers for the most
recent press event are released. This will require that TUI apps
handling release apps are idempotent in their release handling but I
don't think thats unrealistic to expect and I've already been able to
demonstrate at least Kitty sending duplicate release events in some
scenarios so this seems like a safe assumption.
2024-01-27 07:49:04 -08:00
Matt Robenolt
e70ec5d5f4 Only detect links when Super is held down
This stops underlining and changing to a pointer unless Cmd or Ctrl is
held down already.
2024-01-26 20:52:00 -08:00
Matt Robenolt
6c6b42d40c Open links with Super+click
A few people, including myself, many times accidentally click links by
either clicking around aimlessly or getting focus back to Ghostty that
happens to be hovering over a link.

In iTerm2, if you want links enabled, it's always Cmd+Click.
2024-01-26 20:23:40 -08:00
Mitchell Hashimoto
2c924be9b1 core: only dump scrollback contents if there is scrollback
Fixes #1353
2024-01-21 20:55:41 -08:00
Mitchell Hashimoto
4dbd10c913 apprt/embedded: support asking for selection text, existence 2024-01-21 17:22:44 -08:00
Mitchell Hashimoto
344c2db097 renderer/metal: initialize layer in init, handle iOS layer 2024-01-18 18:51:01 -08:00
Mitchell Hashimoto
5fe3900efa core: Apple Emoji should be loaded on any darwin, not just macos
It is available on iOS too.
2024-01-18 15:02:32 -08:00
Mitchell Hashimoto
0277a0fb4c renderer/metal: detect frame commit failures and notify surface 2024-01-16 10:51:36 -08:00
Mitchell Hashimoto
adb7958f61 remove tracy usage from all files 2024-01-13 15:06:08 -08:00
Mitchell Hashimoto
50a119d300 Selection: add adjust method, unit test it, swap for adjustments 2024-01-11 22:14:40 -08:00
Qwerasd
3f3703deb6 Fixed accidentally consuming ALL shift+<key> releases 😅 2024-01-11 21:58:19 -05:00
Qwerasd
8cf3b6bef3 Shift+keys selection: Fixed up/down logic, added page up/down, home, & end. 2024-01-11 21:19:41 -05:00
Qwerasd
e0867801a5 Added use of shift+arrow keys to expand current selection 2024-01-11 20:58:12 -05:00
Mitchell Hashimoto
cba27e26cf input: manage application keypad state with mode 1035
Fixes #1099

We previously applied application keypad mode logic (`ESC=` or mode 66)
whenever it was active. However, from looking at the behavior of other
terminals (xterm and foot) it appears this isn't correct.

For xterm, application keypad mode only applies unconditionally if the
keyboard mode is VT220 (`-kt vt220`). For modern terminals, application
keypad mode is only applied if mode 1035 is disabled.

Mode 1035 is the "ignore numpad state with keypad mode" mode. It
defaults to true on terminal startup. If this is true, keypads are
always encoded in numerical mode. If this is false, the numlock state
will be respected.
2024-01-09 11:57:09 -08:00