4389 Commits

Author SHA1 Message Date
Mitchell Hashimoto
b50ce6bb6a Merge pull request #1176 from tristan957/libadwaita
Use adw_application_new() instead of adw_init()
2023-12-29 09:11:21 -08:00
Mitchell Hashimoto
e43919cb9e apprt/gtk: stylistic changes to adwaita init 2023-12-29 09:10:49 -08:00
Mitchell Hashimoto
6532ff73a8 macos: verify inspector is not nil before sending it to draw 2023-12-29 07:53:20 -08:00
Mitchell Hashimoto
5cef3ced18 Merge pull request #1179 from mitchellh/keypad-maybe
input: only send keypad events for keypad application mode
2023-12-28 20:02:15 -08:00
Tristan Partin
41aa9ac2ff Use adw_application_new() instead of adw_init()
This will enable further libadwaita improvements in the future, but will
have no effect today.
2023-12-28 21:50:56 -06:00
Mitchell Hashimoto
c3fd37f687 Merge pull request #1178 from mitchellh/macos-restore
macos: invalid restorable state when surface is closed
2023-12-28 19:44:16 -08:00
Mitchell Hashimoto
40e882ff48 macos: invalid restorable state when surface is closed
Fixes #1177
2023-12-28 19:39:47 -08:00
Mitchell Hashimoto
f71c597037 Merge pull request #1174 from byildiz/main
Reorder menu items (File, Edit, View ...) like most of the other apps
2023-12-28 13:31:55 -08:00
Burak Yildiz
f3c6066be3 Reorder menu items (File, Edit, View ...) like most of the other apps 2023-12-28 21:43:24 +01:00
Mitchell Hashimoto
3b7dc97ad4 Merge pull request #1173 from mitchellh/release-entitlements
ci: explicitly sign our release entitlements on build
2023-12-28 10:38:22 -08:00
Mitchell Hashimoto
64e3cbf28c ci: explicitly sign our release entitlements on build
Fixes #1169
2023-12-28 10:37:45 -08:00
Mitchell Hashimoto
7fcd4233cd config: not that cursor-style with shell integration overwrites 2023-12-28 09:17:42 -08:00
Mitchell Hashimoto
276ff84583 Merge pull request #1172 from rockorager/delay_syscall
termio: delay repeated `waitpid` syscalls when killing children
2023-12-28 09:16:17 -08:00
Tim Culverhouse
eda76e105f termio: delay repeated waitpid syscalls when killing children
PR #1168 introduced a loop to kill all children. The `waitpid` call is
issued with the NOHANG flag, which means it returns immediately if no
child has exited. This has the effect that we can repeatedly run through
this loop making this syscall, flooding the system with calls and not
getting timely responses. On my system, this caused Ghostty to take ~30
seconds to close. In my attempts to debug, I added logging to the loop
which resolved the issue. To find out why, I added a loop counter and
found the loop would run > 70 million cycles while trying to close. By
adding logging, I introduced just enough delay in the loop cycle to
prevent whatever flooding of syscalls was happening. This reduced the
loop counter to ~2 cycles before closing.

Add a small delay to prevent syscall flooding.
2023-12-28 10:43:33 -06:00
Mitchell Hashimoto
c2a132c068 ci: remove macos unsigned releases 2023-12-27 22:25:38 -08:00
Mitchell Hashimoto
937e41bf79 Merge pull request #1168 from mitchellh/kill
termio: ensure we kill all the children without killing ourselves
2023-12-27 22:01:40 -08:00
Mitchell Hashimoto
e32c031588 termio: ensure we kill all the children without killing ourselves
Fixes #497

This commit resolves two bugs:

First, if a surface is created and destroyed too quickly, the child
process may not have called `setsid` yet (to set the process group). In
this case, `getpgid` returns Ghostty's process group and we were killing
ourselves. We now detect we're about to kill ourselves and wait for our
child to be ready to be killed.

Second, if the child calls setsid but is in the process of execve when
we send a killpg, then the child will be killed but any newly spawned
grandchildren will remain alive. To fix this, we moved the waitpid call
into a kill loop so we can repeatedly kill our child if we detect any
grandchildren are still alive.
2023-12-27 21:44:58 -08:00
Mitchell Hashimoto
1c68dd5b6c Merge pull request #1166 from mitchellh/macos-surface-init
macos: set surface tree on init in restore
2023-12-27 21:31:33 -08:00
Mitchell Hashimoto
0008fb0a27 macos: set surface tree on init in restore
This prevents an unnecessary SurfaceView from being created. Creating a
SurfaceView is very expensive because this starts multiple threads,
creates the pty, starts the pty process, etc.

Additionally, this was exposing what I believe to be #497 when restoring
state: a surface view was created and destroyed very quickly causing
hangs on some machines. This still needs to be resolved but the behavior
in this commit was still a bug anyways.
2023-12-27 20:12:46 -08:00
Mitchell Hashimoto
4f31af13ad Merge pull request #1165 from mitchellh/dangling-notification
macos: notifications use surface UUID for lookups
2023-12-27 09:02:43 -08:00
Mitchell Hashimoto
181cfa1350 macos: notifications use surface UUID for lookups
Fixes #1162
2023-12-27 08:49:12 -08:00
Mitchell Hashimoto
21db51ff9d input: only send keypad events for keypad application mode
Fixes #1099
2023-12-27 08:10:01 -08:00
Mitchell Hashimoto
d648daed6a Merge pull request #1164 from mitchellh/macos-about-select
macos: text in about window is selectable
2023-12-27 07:54:40 -08:00
Mitchell Hashimoto
789107ff1b macos: text in about window is selectable
Fixes #1163

I also fixed the AppIconImage from being 1024x1024 to much smaller so we
don't see as many artifacts in the downsize.
2023-12-27 07:53:28 -08:00
Mitchell Hashimoto
107f1b1050 Merge pull request #1161 from mitchellh/new-surface-uuid
macOS: restore focused split on app state restore
2023-12-26 14:53:00 -08:00
Mitchell Hashimoto
2aa7f12417 macos: increment restorable state version 2023-12-26 14:45:39 -08:00
Mitchell Hashimoto
98041940f0 macos: restore focused split on app restore 2023-12-26 14:45:27 -08:00
Mitchell Hashimoto
a321ef515d macos: assign unique UUID per surface, store in app state 2023-12-26 14:24:05 -08:00
Mitchell Hashimoto
10a1a94b5d Merge pull request #1160 from mitchellh/cursor-scroll
terminal: resize cols should treat old cursor pos as active point
2023-12-26 14:02:24 -08:00
Mitchell Hashimoto
b573ff137a terminal: resize cols should treat old cursor pos as active point
Fixes #1159

The cursor position is an "active" coordinate (defined at the top of
Screen.zig), but our resize was treating it as a "viewport" coordinate.
2023-12-26 13:59:22 -08:00
Mitchell Hashimoto
41ad737b07 Merge pull request #1158 from mitchellh/grapheme-config
config: grapheme-width-method, default to "unicode"
2023-12-25 14:36:26 -08:00
Mitchell Hashimoto
8b3094465d config: grapheme-width-method, default to "unicode"
This adds a new configuration `grapheme-width-method` to change the
default behavior that Ghostty uses to calculate grapheme width. The
default value is `unicode` which is identical to setting mode 2027.

**IMPORTANT:** This changes the default Ghostty behavior to be fully
grapheme-aware including ZWJs, VS15, VS16. This may cause issues with
some legacy programs and shells.

I've changed my mind that this should become the default because enough
people use emojis now that I've found in the beta program there are more
issues reported about "incorrect emoji width" than any possibly desync
issues. We'll see.

For legacy programs, this can still be set to `grapheme-width-method =
wcswidth`.
2023-12-25 14:19:05 -08:00
Mitchell Hashimoto
198e7895c9 Merge pull request #1157 from mitchellh/dependabot/github_actions/cachix/cachix-action-13
build(deps): bump cachix/cachix-action from 12 to 13
2023-12-25 07:09:39 -08:00
dependabot[bot]
6a726ed715 build(deps): bump cachix/cachix-action from 12 to 13
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 12 to 13.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v12...v13)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-25 00:57:44 +00:00
Mitchell Hashimoto
d486f80ce8 Merge pull request #1156 from mitchellh/kitty
input: kitty keyboard modifier event changes from Kitty 0.32
2023-12-24 09:02:43 -08:00
Mitchell Hashimoto
0a1dfae2ef input: kitty keyboard modifier event changes from Kitty 0.32
> When the key event is related to an actual modifier key, the corresponding
> modifier's bit must be set to the modifier state including the effect for the
> current event. For example, when pressing the :kbd:`LEFT_CONTROL` key, the
> ``ctrl`` bit must be set and when releasing it, it must be reset. When both
> left and right control keys are pressed and one is released, the release event
> must have the ``ctrl`` bit set. See :iss:`6913` for discussion of this design.
2023-12-24 08:21:31 -08:00
Mitchell Hashimoto
c783f53d18 Merge pull request #1155 from mitchellh/macos-restore
macOS: restore windows, tabs, splits, working directories, etc. on restart
2023-12-23 19:10:59 -08:00
Mitchell Hashimoto
20f9a3baab macos: reset state version to 1 2023-12-23 18:59:19 -08:00
Mitchell Hashimoto
f615a308e0 config: change window-save-state to default 2023-12-23 18:52:40 -08:00
Mitchell Hashimoto
c3b89fa215 macos: use securecoding for codablebridge to prevent warning
Thanks Matt Polzin!
2023-12-23 18:49:41 -08:00
Mitchell Hashimoto
a8568306c9 macos: store pwd with save/restore state 2023-12-23 17:06:34 -08:00
Mitchell Hashimoto
243379c50f apprt/embedded: ghostty_surface_pwd 2023-12-23 16:59:09 -08:00
Mitchell Hashimoto
2390668834 macos: encode surface tree in state restore 2023-12-23 13:15:46 -08:00
Mitchell Hashimoto
a5d249eb48 config: if window-save-state is never, never restore state 2023-12-22 22:00:25 -08:00
Mitchell Hashimoto
f0bf0fd888 config: window-save-state 2023-12-22 21:51:06 -08:00
Mitchell Hashimoto
59f54a1d88 macos: initial window save/restore is working for frames only 2023-12-22 21:24:27 -08:00
Mitchell Hashimoto
69131af808 Merge pull request #1154 from vancluever/vancluever-macos-middle-click-paste
macos: middle click always pastes from clipboard
2023-12-22 19:02:25 -08:00
Chris Marchesi
ffb9ebf6d9 macos: middle click always pastes from clipboard
Following up on #1145, this changes middle-click behavior on MacOS to
always paste from the system clipboard. This does not alter any of the
selection behavior, i.e. default behavior is to allow paste, but you
still need to manually copy. MacOS users still need to enable
"copy-on-select = clipboard" for that respective functionality.
2023-12-22 17:51:51 -08:00
Mitchell Hashimoto
e9a7b9aa67 Merge pull request #1153 from mitchellh/gtk-icons
apprt/gtk: correct icon path now that our resources dir is in a subdir
2023-12-22 17:06:22 -08:00
Mitchell Hashimoto
1f50406967 apprt/gtk: correct icon path now that our resources dir is in a subdir
From #1132, our resources dir is now someting like `/usr/share/ghostty`,
but GTK icons always go into `/usr/share/icons`. This does a basename on
the resources dir to set the correct directory.
2023-12-22 17:03:34 -08:00