5828 Commits

Author SHA1 Message Date
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
3769c83bdf config: note that mouse hide while typing on macos requires 15+ 2024-09-21 10:03:57 -07:00
Khang Nguyen Duy
d5ab772b66 fix(terminal/PageList): ensure enough pages before first page reuse
Running alacritty/vtebench on some machines causes Ghostty to fail on
`assert(first != last)` when trying to grow scrollback. We now make sure
we have enough pages before trying to reuse pages.
2024-09-21 22:03:06 +07:00
Mitchell Hashimoto
c6bbdfb7bf macos: remove EventSinkHostingView
This was breaking various other features:

  - Popovers stopped working
  - Split divider drag gestures stopped working

For now we document the top part of the window is draggable... we
can look into removing that limitation later.
2024-09-20 22:01:01 -07:00
Mitchell Hashimoto
44e39326b3 Merge pull request #2276 from qwerasd205/macos-titlebar-hidden
macOS: add `macos-titlebar-style = hidden`
2024-09-20 20:50:27 -07:00
Mitchell Hashimoto
f8bdd2b1bb termio: killpg expected to fail on darwin, still go into waitpid loop
Fixes #2273

On macOS, killpg is expected to fail with EPERM because of the way we
launch a login process around it. Before this commit, this caused us to
never call waitpid and reap the child process, which caused the child
process to stick around as a zombie.

This commit allows killpg to fail with EPERM on macOS and fall through
to waitpid.
2024-09-20 15:29:06 -07:00
Qwerasd
ae46ff6854 mention macos-titlebar-style = hidden in window-decoration docs 2024-09-20 16:18:42 -06:00
Qwerasd
16919488da macOS: add macos-titlebar-style = hidden
Hides titlebar without removing the other typical window frame elements
2024-09-20 16:11:51 -06:00
FineFindus
6f3db36251 termio: correct comment about windows support
The comment has conflicting information about supporting windows. This
removes the incorrect information that only windows is supported.
2024-09-20 17:42:08 +02:00
Mitchell Hashimoto
a503e0250e apprt/gtk: add version helpers
This adds version helpers similar to the adwaita version helpers so that
build time and runtime version checks can be done.
2024-09-19 20:24:52 -07:00
Severus
888861984d Fix typo 2024-09-20 10:18:19 +07:00
Mitchell Hashimoto
df5cd719d6 macos: rename overlay config to indication 2024-09-19 20:00:46 -07:00
Severus
b675905cc2 Fix 2271 issue
From GTK 4.16, GDK_DEBUG is splitted into GDK_DEBUG and GDK_DISABLE
2024-09-20 07:55:40 +07:00
Mitchell Hashimoto
a513a02328 config: config to disable auto secure input and secure input overlay 2024-09-19 17:20:54 -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
Yi Ming
74411511df refactor: remove the unnecessary ./ in imports 2024-09-19 15:35:52 +08:00
Yi Ming
2894e78cbe adw: disable all of the default shortcuts 2024-09-19 15:15:47 +08:00
Mitchell Hashimoto
e3d528cf0b termio: use surface messages to trigger password input state 2024-09-18 21:14:05 -07:00
Mitchell Hashimoto
42e7cbc475 termio: typos 2024-09-18 20:59:27 -07:00
Mitchell Hashimoto
66a065dcdd termio: always set termios timer running bool to true on focus
Fixes #2265

See comment in diff for details.
2024-09-18 20:56:40 -07:00
Mitchell Hashimoto
7b7bd5e364 Merge pull request #2262 from ghostty-org/pwinput
Detect password input and render lock glyph
2024-09-18 12:17:43 -07:00
Mitchell Hashimoto
1936ef7fee termio: increase termios poller to 200ms 2024-09-18 12:14:55 -07:00
Mitchell Hashimoto
e8bbc987e0 termio: stop the termios poller when not focused 2024-09-18 11:56:07 -07:00
Mitchell Hashimoto
5c469a0b44 renderer: render lock for password input 2024-09-18 11:14:37 -07:00
Mitchell Hashimoto
39627e3221 termio: set pw input state on terminal and wake up renderer 2024-09-18 10:47:26 -07:00
Mitchell Hashimoto
4f6995d727 termio: poll termios for changes 2024-09-18 10:34:07 -07:00
Paul Berg
a6cd4b9750 adw: clear stored tab overview timer
This prevents a GTK warning:

```
(process:354789): GLib-CRITICAL **: 19:07:01.853: Source ID 511 was not found when attempting to remove it
```

which happens when trying to clean a timer already used.
2024-09-18 19:11:21 +02:00
Mitchell Hashimoto
618264a16e Merge pull request #2258 from gpanders/push-nkpuzyprzkrp
config: move optional path parsing into RepeatablePath
2024-09-18 09:20:12 -07:00
Mitchell Hashimoto
9b7395b830 Merge pull request #2260 from ghostty-org/adw-focus
Fix: AdwTabOverview loses focus on close
2024-09-18 09:12:40 -07:00
Mitchell Hashimoto
e811ea859d renderer/metal: fix compilation issues 2024-09-18 09:10:18 -07:00
Mitchell Hashimoto
2dd454b399 apprt/gtk: refocus the current tab after adw tab overview closes
Fixes #2256
2024-09-18 07:56:32 -07:00
Mitchell Hashimoto
4a492f24be apprt/gtk: make focusCurrentTab safe to call at any time 2024-09-18 07:41:11 -07:00
Mitchell Hashimoto
9c897e29a4 config: return OOM instead of NoSpaceLeft for Linux fmt 2024-09-18 07:35:40 -07:00
Mitchell Hashimoto
c1346d3f1f Merge pull request #2259 from Pangoraw/tabbar-style
gtk: respect window-theme=ghostty when gtk-titlebar=false
2024-09-18 07:12:50 -07:00
Paul Berg
990bcb9573 gtk: respect window-theme=ghostty when gtk-titlebar=false 2024-09-18 13:52:44 +02:00
Gregory Anders
64abbd0ea6 config: move optional path parsing into RepeatablePath
This commit refactors RepeatablePath to contain a list of tagged unions
containing "optional" and "required" variants. Both variants have a null
terminated file path as their payload, but the tag dictates whether the
path must exist or not. This implemenation is used to force consumers to
handle the optional vs. required distinction.

This also moves the parsing of optional file paths into RepeatablePath's
parseCLI function. This allows the code to be better unit tested. Since
RepeatablePath no longer contains a simple list of RepeatableStrings,
many other of its methods needed to be reimplemented as well.

Because all of this functionality is built into the RepeatablePath type,
other config options which also use RepeatablePath gain the ability to
specify optional paths as well. Right now this is only the
"custom-shaders" option. The code paths in the renderer to load shader
files has been updated accordingly.

In the original optional config file parsing, the leading ? character
was removed when paths were expanded. Thus, when config files were
actually loaded recursively, they appeared to be regular (required)
config files and an error occurred if the file did not exist. **This
issue was not found during testing because the presence of the
"theme" option masks the error**. I am not sure why the presence of
"theme" does this, I did not dig into that.

Now because the "optional" or "required" state of each path is tracked
in the enum tag the "optional" status of the path is preserved after
being expanded to an absolute path.

Finally, this commit fixes a bug where missing "config-file" files were
not included in the +show-config command (i.e. if a user had
`config-file = foo.conf` and `foo.conf` did not exist, then `ghostty
+show-config` would only display `config-file =`). This bug applied to
`custom-shaders` too, where it has also been fixed.
2024-09-17 22:08:59 -05:00
Mitchell Hashimoto
0ac29783b9 config: fix regression for recursive config-files from 5ff0841ee65 2024-09-17 16:51:32 -07:00
Mitchell Hashimoto
15a9c191d3 terminal: avoid double free by resetting command to non-managed
Fixes a reported macOS crash. Test case shows how its possible.
2024-09-17 13:15:44 -07:00
Mitchell Hashimoto
5ff0841ee6 Merge pull request #2243 from gpanders/push-yvplumostzqp
config: interpret leading ? in config-file as an optional file
2024-09-17 13:04:52 -07:00
Mitchell Hashimoto
0109cb5ba4 Merge pull request #2248 from ghostty-org/tagged-union
cli: config structure supports tagged unions
2024-09-16 16:01:04 -07:00
Mitchell Hashimoto
a389987ada cli: config structure supports tagged unions
The syntax of tagged unions is `tag:value`. This matches the tagged
union parsing syntax for keybindings (i.e. `new_split:right`).

I'm adding this now on its own without a user-facing feature because
I can see some places we might use this and I want to separate this out.
There is already a PR open now that can utilize this (#2231).
2024-09-16 15:53:59 -07:00
Mitchell Hashimoto
fca7ceed03 apprt/gtk: fix non-libadw builds 2024-09-16 15:08:41 -07:00
Tristan Partin
2ad4dcdc01 apprt/gtk: remove redundant adwaita check
We already check if the toast overlay exists before sending a toast.

Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-16 15:42:38 -05:00
Tristan Partin
4f2c1d1b10 apprt/gtk: use adwaita toasts regardless of gtk-titlebar
Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-16 15:36:10 -05:00
Tristan Partin
46fb3d8c9f apprt/gtk: add notebook widget to the main box
Mitchell dropped this as part of a cleanup in the PR which added
AdwToastOverlay.

Fixes: https://github.com/ghostty-org/ghostty/issues/2250
Link: https://github.com/ghostty-org/ghostty/pull/2235
Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-16 15:16:06 -05:00
Mitchell Hashimoto
c48a1801f6 apprt/gtk: only setup the toast overlay if we have it enabled 2024-09-16 10:18:02 -07:00
Mitchell Hashimoto
2f0b48e8ad apprt/gtk: tweaks 2024-09-16 10:12:16 -07:00
Tristan Partin
d0c6c4f367 apprt/gtk: use toast UX from Adwaita if available
Notify the user with in-app notifications if libadwaita is available.

Co-authored-by: Paul Berg <paul@ber.gp>
Signed-off-by: Tristan Partin <tristan@partin.io>
2024-09-16 11:57:58 -05:00
Paul Berg
89506e5933 gtk: prevent invalid call to adw_tab_view_get_page_position
Creating the first tab would call adw_tab_view_get_page_position with a null page.
2024-09-16 18:10:57 +02:00