133 Commits

Author SHA1 Message Date
Adam Wolf
8102fddceb apprt/gtk: add toggle_maximize keybind and window-maximize config option 2025-01-10 22:42:41 -06:00
Sabarigirish Manikandan
306c7ea2be close_tab keybind (gtk apprt only) (#4033)
Title. Adds a close_tab keybind that essentially behaves the exact same
as clicking the tab close button on the tab bar.
2025-01-08 19:07:00 +00:00
Mitchell Hashimoto
e8811ac6fb Move app quit to apprt action
This changes quit signaling from a boolean return from core app `tick()`
to an apprt action. This simplifies the API and conceptually makes more
sense to me now.

This wasn't done just for that; this change was also needed so that
macOS can quit cleanly while fixing #4540 since we may no longer trigger
menu items. I wanted to split this out into a separate commit/PR because
it adds complexity making the diff harder to read.
2025-01-04 07:18:53 -08:00
Mitchell Hashimoto
29b96be84f tweaks to window position 2025-01-02 13:18:53 -08:00
Adam Wolf
f9250e28b5 chore: rename window-position-{x,y} to window-initial-position-{x,y} 2025-01-02 12:58:40 -08:00
Adam Wolf
970e45559b apprt/glfw: handle setting initial window position when window is
created
2025-01-02 12:58:40 -08:00
Adam Wolf
7195bda7a2 chore: add missing case in switch statement 2025-01-02 12:58:40 -08:00
Adam Wolf
5ced72498e feat(linux): allow setting an intial start position 2025-01-02 12:58:40 -08:00
Mitchell Hashimoto
ab60fbc096 apprt/glfw: add noop keyboardLayout func to satisfy tests and builds 2024-12-11 11:14:45 -08:00
Kyaw
10e37a3dee config: support loading from "Application Support" directory on macOS 2024-11-24 17:08:07 +07:00
Mitchell Hashimoto
00c62708d3 apprt: remove change conditional state action 2024-11-22 11:52:34 -08:00
Mitchell Hashimoto
0a794addf1 apprt/glfw: update to new reload config action 2024-11-22 11:52:34 -08:00
Mitchell Hashimoto
fadfb08efe apprt: add config_change action 2024-11-21 10:30:27 -08:00
Mitchell Hashimoto
b7f1eaa145 apprt: action to change conditional state, implement for embedded 2024-11-19 15:36:31 -08:00
Mitchell Hashimoto
3ca246ceb9 apprt: support a pwd change action 2024-11-13 12:29:30 -08:00
Mitchell Hashimoto
1065359b9a apprt: rename set_bg/fg to "color_change" to report all color changes 2024-10-30 16:33:18 -04:00
CJ van den Berg
a2a1d93d5c apprt: propagate OSC10/11 (set term fore/background color) through to apprt
This is to allow the running apprt to set the UI theme to match the
terminal application coloring.
2024-10-30 17:35:34 +01:00
axdank
520dda65cb apply review changes 2024-10-25 08:07:11 -03:00
axdank
465d60def8 gui: add move_current_tab action 2024-10-24 00:01:54 -03:00
Mitchell Hashimoto
463f4afc05 apprt/glfw: exit with invalid CLI args 2024-10-18 08:21:42 -07:00
Mitchell Hashimoto
a4e14631ef config: richer diagnostics for errors
Rather than storing a list of errors we now store a list of
"diagnostics." Each diagnostic has a richer set of structured
information, including a message, a key, the location where it occurred.

This lets us show more detailed messages, more human friendly messages, and
also let's us filter by key or location. We don't take advantage of
all of this capability in this initial commit, but we do use every field
for something.
2024-10-18 08:11:11 -07:00
Mitchell Hashimoto
eec77e271c macos: change our minimum version to macOS 13
macOS 12 is officially EOL by Apple and the project only supports
officially supported versions of macOS. Once publicly released, users on
older macOS versions will have to use older released builds.
2024-10-09 14:41:57 -07:00
Mitchell Hashimoto
5c1ffbb642 apprt: implement key_sequence action 2024-10-08 21:55:00 -07:00
Roland Peelen
24ba1a6100 Add action on Zig side 2024-10-02 10:33:36 -07:00
Mitchell Hashimoto
1570ef01a7 rename slide to quick terminal 2024-09-28 15:20:35 -07:00
Mitchell Hashimoto
7806366eec core: fix up toggle_slide_terminal action for rebase 2024-09-27 18:36:06 -07:00
Paul Berg
f1474c220d bind: add toggle_tab_overview binding 2024-09-27 10:13:05 -07:00
Mitchell Hashimoto
4ae20212bf libghostty: unified action dispatch
First, this commit modifies libghostty to use a single unified action
dispatch system based on a tagged union versus the one-off callback
system that was previously in place. This change simplifies the code on
both the core and consumer sides of the library. Importantly, as we
introduce new actions, we can now maintain ABI compatibility so long as
our union size does not change (something I don't promise yet).

Second, this moves a lot more of the functions call on a surface into
the action system. This affects all apprts and continues the previous
work of introducing a more unified API for optional surface features.
2024-09-26 22:00:11 -07:00
Mitchell Hashimoto
4cc4eb5ed0 core: remove more hasdecls 2024-09-26 14:21:06 -07:00
Mitchell Hashimoto
e29918ebb8 core: more actions 2024-09-26 10:20:44 -07:00
Mitchell Hashimoto
9202cba1f5 core: many more actions 2024-09-26 10:05:10 -07:00
Mitchell Hashimoto
1e010b8e08 core: more actions 2024-09-26 09:37:31 -07:00
Mitchell Hashimoto
02d7e766e1 core: move password input into action enum 2024-09-25 11:43:48 -07:00
Mitchell Hashimoto
0e043bc0e4 apprt: transition all hasDecls in App.zig to use the new action dispatch 2024-09-25 11:28:10 -07:00
Mitchell Hashimoto
13603c51a9 apprt: begin transition to making actions an enum and not use hasDecl 2024-09-25 11:02:45 -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
18419d3589 Clamp initial window size configurations to screen size
Fixes #2145
2024-08-26 10:09:05 -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
36648ae397 apprt: stubs for mouseOverLink 2024-07-06 10:29:23 -07:00
Mitchell Hashimoto
03f37087a5 mouse button callbacks returns bool for consumption 2024-06-30 09:42:15 -07:00
Mitchell Hashimoto
506ba854fa core: font size changes work 2024-04-06 19:33:49 -07:00
Mitchell Hashimoto
bf4211e060 input: handle more ctrl+<key> sequences, namely ctrl+_
Previously, we encoded `ctrl+_` in the CSIu format[1]. This breaks most
notably emacs which expects the legacy ambiguous encoding.

This commit utilizes the generator from Kitty to generate our control
key mappings. We also switch from keycode mapping to key contents
mapping which appears to be the correct behavior also compared to other
terminals.

In the course of doing this, I also found one bug with our fixterms
implementation. Fixterms states: "The Shift key should not be considered
as a modifier for Unicode characters, because it is most likely used to
obtain the character in the first place (e.g. the shift key is often
required to obtain the ! symbol)." We were not applying that logic and
now do.

[1]: https://www.leonerd.org.uk/hacks/fixterms/
2024-01-25 15:25:23 -08:00
Mitchell Hashimoto
adb7958f61 remove tracy usage from all files 2024-01-13 15:06:08 -08:00
Mitchell Hashimoto
b711ac8a42 apprt/glfw: implement openconfig 2023-12-18 08:20:29 -08:00
Brian Cain
ed3e436e47 apprt: Fix key callback input key assignments
Prior to this commit, two and three were not properly assigned. This
commit updates that to assign two to two, and three to three.
2023-12-15 11:23:52 -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
9de5d991a2 core: detect inputs that result in surface close and avoid segfault
Fixes #965

When processing keybindings that closed the surface (`close_surface`,
`close_window`), the surface and associated runtime structures would be
freed so we could segfault.

This PR introduces a new enum result for input events (only key for now)
that returns whether an event resulted in a close. In this case, callers
can properly return immediately and avoid writing to deallocated memory.
2023-12-07 10:24:39 -08:00
Mitchell Hashimoto
67dce5ce0e update zig-objc 2023-11-17 21:50:34 -08:00
Gregory Anders
5290070be9 clipboard: add Clipboard variant for primary clipboard
In practice, the primary and selection clipboards are treated exactly
the same, but this allows OSC 52 sequences to use either 's' or 'p' as
the clipboard target.
2023-11-16 16:35:48 -06:00
Gregory Anders
593cfa256c glfw: fix compile error 2023-11-11 17:21:10 -05:00