10789 Commits

Author SHA1 Message Date
Kristófer R
73e5f7e5d6 merge std.Uri.ParseError and os/hostname error sets 2025-06-07 22:12:26 -04:00
Kristófer R
e4a175d24a use explicit error set 2025-06-07 22:07:18 -04:00
Kristófer R
7760389ab8 add comptime check for platform
we only need the mac-address-as-hostname workaround on macos, so we
now have a comptime check to see if we're on macos.
2025-06-07 22:07:18 -04:00
Kristófer R
68f48b9911 name the 17 magic constant mac_address_length 2025-06-07 22:07:18 -04:00
Kristófer R
dfdb588f58 add tests for hostnames without a path component 2025-06-07 22:07:18 -04:00
Kristófer R
a24d0c9faf re-order end-of-hostname validity check 2025-06-07 22:07:18 -04:00
Kristófer R
bb07e9c026 don't rely on hard-coded schemes 2025-06-07 22:07:18 -04:00
Kristófer R
7a639a7119 use iterator syntax in for loop 2025-06-07 22:07:18 -04:00
Kristófer R
e0655a7f75 Move url parsing helper to os/hostname
Also adds a test to verify that the function is working as intended.
2025-06-07 22:07:18 -04:00
Kristófer R
ffe7f0d8bf extract url parsing into its own function 2025-06-07 22:07:18 -04:00
Kristófer R
64bfaf23f9 take kitty-shell-cwd scheme into account 2025-06-07 22:07:17 -04:00
Kristófer R
b66368b4d6 extract mac address validity check to function 2025-06-07 22:07:17 -04:00
Kristófer R
19ca1bfb1c Fix modulo operation and custom Uri struct init 2025-06-07 22:07:17 -04:00
Kristófer R
0e74b8027a pwd: fix hostname resolution on macos
When macOS's "Private WiFi address" feature is enabled it'll change the
hostname to a mac address. Mac addresses look like URIs with a hostname
and port component, e.g. 12:34:56:78:90:12 where `:12` looks like port
12. However, mac addresses can also contain letters a through f, so a
valid mac address like ab💿ef🆎cd:ef is valid, but will not be parsed
as a URI, because `:ef` is not a valid port.

This commit attempts to fix that by checking if the hostname is a valid
mac address when `std.Uri.parse()` fails and constructing a new std.Uri
struct using that information.

It's not perfect, but is equally compliant with the URI spec as std.Uri
currently is.
2025-06-07 22:07:17 -04:00
mitchellh
3b33813071 deps: Update iTerm2 color schemes 2025-06-08 00:14:39 +00:00
Mitchell Hashimoto
e986beb6a7 input: parse binds containing equal signs correctly (#7544)
Since the W3C rewrite we're able to specify codepoints like `+` directly
in the config format who otherwise have special meanings. Turns out we
forgot to do the same for `=`.
2025-06-07 16:30:01 -07:00
Leah Amelia Chen
ba15da4722 input: parse binds containing equal signs correctly
Since the W3C rewrite we're able to specify codepoints like `+` directly
in the config format who otherwise have special meanings. Turns out we
forgot to do the same for `=`.
2025-06-08 01:12:17 +02:00
Leah Amelia Chen
990d1cdf37 gtk/CommandPalette: prevent leaks on initialization (#7541)
* Deallocate the builder after use
* Don't hold a reference to `Command` after appending to `GListStore`
2025-06-07 23:15:16 +02:00
Mitchell Hashimoto
6f6d493763 macos: show quick terminal on undo/redo 2025-06-07 13:14:21 -07:00
Mitchell Hashimoto
6e77a5a6ca macos: address quick terminal basic functionality with new API 2025-06-07 13:07:31 -07:00
Mitchell Hashimoto
537b5101c6 os/flatpak: fix resource leaks in FlatpakHostCommand (#7542)
This PR solves a few resource leaks in `FlatpakHostCommand`:

- Threads created by `FlatpakHostCommand.spawn` are now detached,
allowing its resources to be released.
- Errors created by various `glib`/`gio` APIs are now freed after use.
2025-06-07 12:57:34 -07:00
Mitchell Hashimoto
20744f0482 macos: fix some CI build issues 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
973a2afdde macos: make sure we're not registering unnecessary undos 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
b234cb2014 macos: only process reopen if already activated 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
396e53244d config: add super+shift+t as a default undo too to mimic browsers 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
aeede903f5 macos: undo close all windows 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
d92db73f25 macos: undo new tab 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
636b1fff8a macos: initial window shouldn't support undo 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
797c10af37 macos: undo new window 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
33d128bcff macos: remove TerminalManager
All logic related to TerminalController is now in TerminalController.
2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
3b77a16b63 Make undo/redo app-targeted so it works with no windows 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
5507ec0fc0 macos: compile errors in CI 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
966c4f98c7 apprt/glfw,gtk: noop undo/redo actions 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
d2d3852026 macos: remove debug log 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
49cc88f0d3 macos: configurable undo timeout 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
3e02c0cbd5 macos: fix an incorrect bindable write during view update 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
b044f4864a add undo/redo keybindings, default them on macOS 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
e1847da139 macos: more robust undo tab that goes back to the same position 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
5f74445b14 macos: basic undo tab, not quite working 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
104cc2adfe macos: basic undo close window, not very robust yet 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
f571519157 macos: setup undo responders at the AppDelegate level 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
6d32b01c64 macos: implement a custom ExpiringUndoManager, setup undo for new/close 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
493b1f5350 wip: undo 2025-06-07 12:46:13 -07:00
Mitchell Hashimoto
e70a4682ac macos: quick terminal restores previous size when exiting final surface (#7543)
This fixes a regression from the new split work last week, but it was
also probably an issue before that in a slightly different way.

With the new split work, the quick terminal was becoming unusable when
the final surface explicitly `exit`-ed, because AppKit/SwiftUI would
resize the window to a very small size and you couldn't see the new
terminal on the next toggle.

Prior to this, I think the quick terminal would've reverted to its
original size but I'm not sure (even if the user resized it manually).

This commit saves the size of the quick terminal at the point all
surfaces are exited and restores it when the quick terminal is shown the
next time with a new initial surface.
2025-06-07 12:46:04 -07:00
Mitchell Hashimoto
41ee578b7a macos: quick terminal restores previous size when exiting final surface
This fixes a regression from the new split work last week, but it was
also probably an issue before that in a slightly different way.

With the new split work, the quick terminal was becoming unusable when
the final surface explicitly `exit`-ed, because AppKit/SwiftUI would
resize the window to a very small size and you couldn't see the new
terminal on the next toggle.

Prior to this, I think the quick terminal would've reverted to its
original size but I'm not sure (even if the user resized it manually).

This commit saves the size of the quick terminal at the point all
surfaces are exited and restores it when the quick terminal is shown the
next time with a new initial surface.
2025-06-07 12:37:44 -07:00
Leorize
53c2874667 flatpak: free GError after use 2025-06-07 14:34:55 -05:00
Leorize
42bafe9d59 flatpak: detach process tracking thread after spawn
This makes sure the underlying thread implementation know to free
resources the moment the thread is no longer necessary, preventing leaks
from not manually collecting the thread.
2025-06-07 14:34:39 -05:00
Leorize
ea0766e62b gtk/CommandPalette: prevent leaks on initialization
* Deallocate the builder after use
* Don't hold a reference to `Command` after appending to `GListStore`
2025-06-07 12:00:51 -05:00
Mitchell Hashimoto
1c7623db81 terminal: fix crash when reflowing grapheme with a spacer head (#7537)
Fixes #7536

When we're reflowing a row and we need to insert a spacer head, we must
move to the next row to insert it. Previously, we were setting a spacer
head and then copying data into that spacer head, which could lead to
corrupt data and an eventual crash.

In debug builds this triggers assertion failures but in release builds
this would lead to silent corruption and a crash later on.

The unit test shows the issue clearly but effectively you need a
multi-codepoint grapheme such as `👨‍👨‍👦‍👦` to wrap across a row by
changing the columns.
2025-06-07 06:53:01 -07:00
Mitchell Hashimoto
aab00da242 terminal: fix crash when reflowing grapheme with a spacer head
Fixes #7536

When we're reflowing a row and we need to insert a spacer head, we must
move to the next row to insert it. Previously, we were setting a spacer
head and then copying data into that spacer head, which could lead to
corrupt data and an eventual crash.

In debug builds this triggers assertion failures but in release builds
this would lead to silent corruption and a crash later on.

The unit test shows the issue clearly but effectively you need a
multi-codepoint grapheme such as `👨‍👨‍👦‍👦` to wrap across a row by changing
the columns.
2025-06-06 20:37:12 -07:00