6440 Commits

Author SHA1 Message Date
isabel
982c01feb5 nix: inherit lib from unstable 2024-06-23 13:22:53 +01:00
Mitchell Hashimoto
3b36dbb53e font/coretext: cached fonts uses unmanaged arraylist 2024-06-22 20:56:23 -07:00
Mitchell Hashimoto
2607446235 font: add noop endFrame calls to all other shapers 2024-06-22 20:49:10 -07:00
Mitchell Hashimoto
9271fd50b6 cache_table and ref_counted_set work on 32-bit machines 2024-06-22 20:45:30 -07:00
Mitchell Hashimoto
71353d016e coretext shaper owns CFReleaseThread, works on both Metal and OpenGL now 2024-06-22 20:42:59 -07:00
Mitchell Hashimoto
4325dc51bc font: coretext shaper owns the cf release pool 2024-06-22 20:32:24 -07:00
Mitchell Hashimoto
3038cb4979 Move CFReleaseThread to os package 2024-06-22 20:15:59 -07:00
Mitchell Hashimoto
4aa130b0d1 CacheTable tests, style changes 2024-06-22 20:08:02 -07:00
Mitchell Hashimoto
8258e9029c nix: revert back to 23.05 for now 2024-06-22 19:37:49 -07:00
isabel
81344faeca build(nix): include more into source; ignore flake comapct 2024-06-21 18:19:14 +01:00
isabel
a73e0183d3 refactor(nix): specify source
this should reduce the amount of rebuilds that need to occur that due to
the souce changing invalidating the cache

also note that a update to nixpkgs-stable had to occur such that the new
lib functions existed
2024-06-21 15:17:43 +01:00
Mitchell Hashimoto
89fa275eeb Merge pull request #1868 from ghostty-org/invert-constrained
renderer/opengl: invert cursor cell text when glyph is constrained
2024-06-18 18:02:50 -04:00
Mitchell Hashimoto
6f43c01b76 renderer/opengl: invert cursor cell text when glyph is constrained
Fixes #1867
2024-06-18 14:59:49 -07:00
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