6927 Commits

Author SHA1 Message Date
Mitchell Hashimoto
067db2af18 Merge pull request #1858 from SkamDart/focus-follows-mouse
feat: focus follows mouse for splits
2024-06-18 17:09:54 -04:00
Mitchell Hashimoto
50019bc766 minor comment changes 2024-06-18 17:09:29 -04:00
Mitchell Hashimoto
ba1ea858cd Merge pull request #1863 from robbiev/fix-macos-inspector-focus
macos: regain window focus on inspector toggle
2024-06-18 17:00:54 -04:00
Mitchell Hashimoto
bf04942d15 Merge pull request #1862 from robbiev/fix-nix-develop
Nix dev env to not depend on deleted Zig release
2024-06-17 22:27:50 -04:00
Robbie Vanbrabant
693a599084 macos: regain window focus on inspector toggle
Fixes #734

I don't know much about SwiftUI, but here's why I think this works.

- Moving the `inspectorVisible` logic to an `onChange` ensures the view
  has at least seen that change.
- The dispatch to the main thread is still necessary to ensure the view
  hierarchy has completely updated after `inspectorVisible`.

Note that this fix is to correctly regain focus. We still lose window
focus very briefly.
2024-06-14 19:22:50 +01:00
Qwerasd
3f3db4896b add CFReleasePool handling to OpenGL renderer 2024-06-14 02:07:17 -04:00
Qwerasd
053500da38 shaper/coretext: update tests 2024-06-14 01:57:46 -04:00
Qwerasd
626ec2b5ac perf: introduce CFReleaseThread for running CoreFoundation releases
Some CoreFoundation objects, such as those produced by CoreText, have
expensive callbacks that run when they are released. By offloading the
CFRelease calls to another thread, we can avoid important threads being
blocked by unexpectedly expensive callbacks.

This commit also changes the way that the coretext shaper's run iterator
builds its string. Rather than using a CFMutableString, an ArrayList of
unichars is built which is passed to CFStringCreateWithCharactersNoCopy,
which is a lot more efficient since it avoids all the CoreFoundation
overhead.
2024-06-14 01:43:02 -04:00
Qwerasd
04896a14b4 perf(shaper/coretext): cache fonts between shape calls 2024-06-14 00:14:53 -04:00
Qwerasd
9741b3a18c perf: introduce RefCountedSet structure, use it for Style.Set 2024-06-13 22:59:03 -04:00
Robbie Vanbrabant
bab4abcc6b Nix dev env to not depend on deleted Zig release
This is the result of running `nix flake update zls`.

For some reason updating zig itself doesn't help. There are two mentions
of zig-overlay in the lock file so I imagine that has something to do
with that. As in - the version used by zls was the one with the problem.

Fixes this isssue:

```
$ nix develop --extra-experimental-features flakes --extra-experimental-features nix-command
error: builder for '/nix/store/yhhlna9rbdfcrzyxnl9gpaf2wac2swr7-zig-macos-x86_64-0.12.0-dev.3480+9dac8db2d.tar.xz.drv' failed with exit code 1;
       last 7 log lines:
       >
       > trying https://ziglang.org/builds/zig-macos-x86_64-0.12.0-dev.3480+9dac8db2d.tar.xz
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0   303    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 403
       > error: cannot download zig-macos-x86_64-0.12.0-dev.3480+9dac8db2d.tar.xz from any mirror
       For full logs, run 'nix-store -l /nix/store/yhhlna9rbdfcrzyxnl9gpaf2wac2swr7-zig-macos-x86_64-0.12.0-dev.3480+9dac8db2d.tar.xz.drv'.
error: 1 dependencies of derivation '/nix/store/wg3w03dlw05rha5cfc7nvllffhzihwnc-zig-0.12.0-dev.3480+9dac8db2d.drv' failed to build
error: 1 dependencies of derivation '/nix/store/x6dhn56cw9ndr496vh50gqafnqf8vyqa-zls.drv' failed to build
error: 1 dependencies of derivation '/nix/store/hrwa46pabh3jvbx71c3194plf9pjifqz-ghostty-env.drv' failed to build
```
2024-06-13 19:24:45 +01:00
Cameron Dart
406d494e1d feat(gtk): focus follows mouse 2024-06-13 00:59:38 +00:00
Cameron Dart
92e16ccbf7 no early return 2024-06-10 18:23:06 -07:00
Cameron Dart
fc52acd47a update config in TerminalController.windowDidLoad and TerminalController.configDidReload 2024-06-10 18:22:28 -07:00
Cameron Dart
29fb70197c macos: surface focus follow mouse 2024-06-10 16:07:33 -07:00
Cameron Dart
97bb595505 macos: add to config 2024-06-10 16:06:57 -07:00
Cameron Dart
fd786219d1 feat: focus-follows-mouse 2024-06-10 13:11:53 -07:00
Qwerasd
8d76b5f283 perf: introduce CacheTable strcture, use it for shaper cache 2024-06-10 13:58:35 -04:00
Qwerasd
db2cefb668 misc: improve rebuildCells time logging 2024-06-10 12:20:49 -04:00
Mitchell Hashimoto
4e4b6ea6de Merge pull request #1856 from ghostty-org/status
Reject invalid DECSASD display
2024-06-09 18:25:03 -07:00
Mitchell Hashimoto
279921b936 terminal: reject invalid DECSASD status code 2024-06-09 21:22:37 -04:00
Mitchell Hashimoto
e2b4ee99e5 terminal: add easy debug mode for stream debugging 2024-06-09 21:22:23 -04:00
Mitchell Hashimoto
c69dc0e0e1 migrate termio.Options.LinuxCgroup to Command 2024-06-08 19:10:19 -07:00
Mitchell Hashimoto
508922efd0 Merge pull request #1848 from jcollie/clone_into_cgroup
Use clone3 / CLONE_INTO_CGROUP on Linux
2024-06-08 19:09:19 -07:00
Mitchell Hashimoto
6ae6e3ba11 remove unused var 2024-06-08 19:08:05 -07:00
Mitchell Hashimoto
8f9cdff1f5 small stylistic tweaks 2024-06-08 19:07:10 -07:00
Mitchell Hashimoto
e2772eacec Merge pull request #1846 from kdrag0n/buffered-scrollback-file
scrollback: buffer writes to scrollback file
2024-06-08 14:56:13 -07:00
Mitchell Hashimoto
55a9268322 Merge pull request #1852 from ghostty-org/unsafe
consider any paste with bracketed paste closer unsafe
2024-06-08 14:46:34 -07:00
Mitchell Hashimoto
fb7cbd69c0 core: consider any paste with bracketed paste closer unsafe
Thanks to: https://thejh.net/misc/website-terminal-copy-paste

If a paste has the ending sentinel value for a bracketed paste
("\x1b[201~") then the shell may start processing data faster. We now
consider this unsafe even if the `clipboard-paste-bracketed-safe`
setting is true.
2024-06-08 14:38:49 -07:00
Jeffrey C. Ollie
af9efd4d93 use consistent type for pid 2024-06-08 07:43:44 -06:00
Jeffrey C. Ollie
e6f97c28f8 Use clone3 / CLONE_INTO_CGROUP on Linux
Use clone3 / CLONE_INTO_CGROUP to have the Linux kernel create the process in the
correct cgroup rather than move the process into the cgroup after it is created.
2024-06-07 23:48:03 -06:00
Danny Lin
197b873dee scrollback: buffer writes to scrollback file
Screen.dumpString writes one character at a time, so buffer writes to
the scrollback file to speed it up.
2024-06-07 20:52:08 -07:00
Mitchell Hashimoto
6bd8cfb840 Merge pull request #1842 from ghostty-org/font-crash
font: preload deferred faces in SharedGrid to avoid data races
2024-06-07 20:35:14 -07:00
Mitchell Hashimoto
919b00571a font: preload deferred faces in SharedGrid to avoid data races
Fixes #1722

Previously, SharedGrid.getIndex would properly lock any access to search
for and load the face metadata for a font face that contains a
codepoint. However, that face may be "deferred" (metadata loaded but the
actual face not loaded).

Later, outside of the SharedGrid write lock, a deferred face may be
initialized and cause a data race if two threads are doing this at the
same time, sometimes loading to a crash.

This commit fixes the issue by always preloading font indexes in
getIndex because the usage of getIndex implies a very near term future
use of getFace.
2024-06-07 20:35:01 -07:00
Mitchell Hashimoto
0d94fb61c9 terminal: all cursor movement needs to mark the old and new page dirty 2024-06-07 15:03:02 -07:00
Mitchell Hashimoto
c2b0bb6395 terminal: mark old/new rows as dirty when moving the cursor absolute 2024-06-07 14:55:02 -07:00
Mitchell Hashimoto
5092cb55ad Merge pull request #1837 from ghostty-org/titlebar-style
macos: macos-titlebar-style, remove titlebar-tabs option
2024-06-07 13:15:14 -07:00
Mitchell Hashimoto
50f05d9ea6 Merge pull request #1838 from ghostty-org/macos-terminal-style
macOS: prefer window shadowing (configurable), move blur config to window controller
2024-06-07 12:52:21 -07:00
Mitchell Hashimoto
550a9be241 config: introduce macos-window-shadow 2024-06-07 12:46:14 -07:00
Mitchell Hashimoto
5a026cf1a2 macos: set background color on transparency that matches Terminal.app 2024-06-07 12:35:57 -07:00
Mitchell Hashimoto
25484d2ccc macos: set background opacity/blur on window controller not surface 2024-06-07 12:31:45 -07:00
Mitchell Hashimoto
4dde7edfab config: macos-titlebar-style, remove titlebar-tabs option
Fixes #1833

This is an attempt to simplify the logic that has organically grown
convoluted over time with regards to how the titlebar and tab bar is
styled.

This field is one unified field that ONLY addresses titlebar and tab bar
styling. It can be one of "native", "transparent", or "tabs". The
"native" field is the new behavior in this commit: it makes the titlebar
and tab bar appearance be absolutely native. We do not color anything
(if we do its a bug).

The "transparent" option is the previous `macos-titlebar-tabs = false`
setting where the titlebar/tab bar is native but colored according to
the window background color.

The "tabs" option is `macos-titlebar-tabs = true`.

The `window-theme = auto` affect on titlebar appearance has been
removed. Now, the titlebar will NEVER be styled with "native" and MAY be
styled with "transparent" and will ALWAYS be styled with "tabs" (since
that's a totally custom look anyways).
2024-06-07 12:12:48 -07:00
Mitchell Hashimoto
6dd88a1bb2 Merge pull request #1835 from jparise/childprocess
os: std.ChildProcess -> std.process.Child
2024-06-07 09:45:08 -07:00
Jon Parise
b1e1d8c3eb os: std.ChildProcess -> std.process.Child
std.ChildProcess was deprecated in favor of std.process.Child a few
releases back, and the old name is removed in Zig 0.13.0.
2024-06-07 12:36:30 -04:00
Mitchell Hashimoto
54ccefe838 Merge pull request #1832 from rockorager/csiDispatch-alias
stream: remove redundant alias handling in csiDispatch
2024-06-06 18:40:35 -07:00
Tim Culverhouse
4eddd919ef stream: remove redundant alias handling in csiDispatch
The alias handling block only handles one alias, which is already
handled in the switch statement. Remove this block and rename all
references to 'action' back to 'input'.
2024-06-06 20:15:58 -05:00
Mitchell Hashimoto
e66d11ac69 Merge pull request #1830 from ghostty-org/xdg-title
xdg-terminal-exec invocations set title based on command
2024-06-06 14:53:31 -07:00
Mitchell Hashimoto
be598be6de config: xdg-terminal-exec parsing should ignore the initial "-e" 2024-06-06 14:50:04 -07:00
Mitchell Hashimoto
1093ccecb4 xdg-terminal-exec invocations set title based on command
Fixes #1724

See background in #1724. The general idea is that for Ghostty
invocations via xdg-terminal-exec, we set the initial title to the
command automatically so that window managers can modify the styling.

We only do this for xdg-terminal-exec because that protocol/spec is
specifically for the scenario that the terminal is being used to launch
a command from the desktop environment.
2024-06-06 10:01:32 -07:00
Mitchell Hashimoto
56871c3828 Merge pull request #1828 from ghostty-org/cgroup
Linux: Launch each terminal surface into its own cgroup
2024-06-06 09:28:38 -07:00