1360 Commits

Author SHA1 Message Date
Mitchell Hashimoto
4a1ff37d63 build conformance into dedicated directory 2023-02-10 08:43:32 -08:00
Mitchell Hashimoto
7d16acdf06 build: add comptime check to verify Zig version 2023-02-08 15:42:41 -08:00
Mitchell Hashimoto
9a5c1cce26 Merge pull request #71 from mitchellh/dependabot/github_actions/cachix/install-nix-action-19
build(deps): bump cachix/install-nix-action from 18 to 19
2023-02-06 16:57:02 -08:00
dependabot[bot]
ba55791a51 build(deps): bump cachix/install-nix-action from 18 to 19
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 18 to 19.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v18...v19)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-07 00:20:04 +00:00
Mitchell Hashimoto
b124162eda Merge pull request #70 from mitchellh/libxev
This completely drops libuv as a dependency and uses [libxev](https://github.com/mitchellh/libxev) instead.

The _primary_ reason to do this is easier building, cross-compiling, and the ability to write a WASM backend in the future. However, we don't want to do this unless it has a positive or null impact on performance. On this, we've succeeded!

The performance impact on Linux is very small. The performance impact on macOS is quite large (I'm seeing almost 40% faster on IO heavy workloads). On both platforms, the stddev of IO heavy workloads is much smaller. This isn't libxev itself, this is primarily do to switching to the dedicated read thread (more next).

This PR also has an architectural change: the TTY reads now happen on a dedicated thread _outside the event loop_. I realized that TTY reads are almost always very small and under heavy IO load, the event loop overhead is very heavy. This is particularly true with io_uring since it uses an kernel threadpool under the covers and the context switch cost was very visible. Another factor is that TTY reads are almost always the only thing impacting terminal state. So if we wrap the terminal state in a lock (we already do), there is almost no overhead to moving the reads to a thread since locks aren't slow, lock contention is slow, and we have almost no lock contention under typical loads.

The main impact of the dedicated TTY reader thread is that there is no event loop overhead and the "jitter" between IO reads is now very small.

🚀
2023-02-06 16:18:19 -08:00
Mitchell Hashimoto
695a9f3cb9 termio: fix pty close error so close doesn't hang on macOS 2023-02-06 16:05:41 -08:00
Mitchell Hashimoto
469d395997 termio: fix TODO around cursor reset 2023-02-06 15:51:55 -08:00
Mitchell Hashimoto
7c360eb29a termio: better commenting on what is going on 2023-02-06 15:45:32 -08:00
Mitchell Hashimoto
91ace8af64 termio: IO reader thread cleanup works 2023-02-06 15:41:28 -08:00
Mitchell Hashimoto
11d6e91228 termio: reader thread is thread-safe for writing to writer 2023-02-06 14:52:24 -08:00
Mitchell Hashimoto
18f20add34 pkg/libuv: delete 2023-02-06 13:07:47 -08:00
Mitchell Hashimoto
a5d03d1318 termio: use a dedicated io reader thread? 2023-02-05 21:33:15 -08:00
Mitchell Hashimoto
24373d84af update libxev 2023-02-05 21:20:49 -08:00
Mitchell Hashimoto
f07e21c22e remove libuv from build 2023-02-04 17:37:51 -08:00
Mitchell Hashimoto
7e6a86f065 termio: use libxev (with TODOs) 2023-02-04 11:47:51 -08:00
Mitchell Hashimoto
ad10b2cf0b vendor update 2023-02-04 11:47:46 -08:00
Mitchell Hashimoto
ad83668234 vendor/libxev update 2023-02-01 19:04:03 -08:00
Mitchell Hashimoto
1273527048 renderer uses libxev
Still some bugs and TODOs, but it is workable.
2023-02-01 15:52:22 -08:00
Mitchell Hashimoto
28ed8573b6 update libxev 2023-02-01 15:52:12 -08:00
Mitchell Hashimoto
60fca27c33 vendor/libxev 2023-01-30 19:17:43 -08:00
Mitchell Hashimoto
e438539a14 Fix new log function options for zig 2023-01-26 09:10:09 -08:00
Mitchell Hashimoto
f2b59353ab window (mac): recalculate sizes on new tab
When a new tab is added, the tab bar may appear which causes our size
grid size calculation to become invalidated. We weren't updating this
previously, which had the effect of mouse selection being in the wrong
place. There were likely other effects...

Fixes https://github.com/mitchellh/ghostty/issues/69
2023-01-26 08:54:09 -08:00
Mitchell Hashimoto
414201abf9 update zig 2023-01-26 08:52:46 -08:00
Mitchell Hashimoto
df52fae76a terminal: check OSC parser for tmux 112 sequences from HN
Saw this on HN:
https://github.com/darrenstarr/VtNetCore/pull/14

I wanted to see if ghostty was vulnerable to it (it is not). But, its a
good example of a weird edge case in the wild and I wanted to make sure
it was redundantly tested. It looks like we read the "spec" (blog posts,
man pages, source of other terminal using tools, etc.) right.
2023-01-17 21:47:38 -08:00
Mitchell Hashimoto
e9bf2a5680 pkg/objc: extract to zig-objc repo 2023-01-02 21:35:32 -08:00
Mitchell Hashimoto
f1e62cfba4 vendor: update tracy to 0.8.2 to match latest nix version 2022-12-31 09:29:50 -08:00
Mitchell Hashimoto
230157d60b remove unused import 2022-12-31 09:07:14 -08:00
Mitchell Hashimoto
e8a1fe4d87 move wasm target struct around to avoid analyzing wasm file on non-wasm 2022-12-31 09:04:11 -08:00
Mitchell Hashimoto
8b6128ddfc start making the src more wasm target aware 2022-12-31 08:57:12 -08:00
Mitchell Hashimoto
ce490e21ea can specify a wasm target in build 2022-12-31 08:53:11 -08:00
Mitchell Hashimoto
1093cf5254 config: enable passwd isn't compiled for wasm 2022-12-30 16:32:49 -08:00
Mitchell Hashimoto
7c291a2c4c config: API for wasm 2022-12-30 16:19:54 -08:00
Mitchell Hashimoto
58218af2b5 app: make apprt agnostic 2022-12-30 15:56:42 -08:00
Mitchell Hashimoto
83f5d29ae2 initialize glfw in app 2022-12-30 15:48:45 -08:00
Mitchell Hashimoto
13111a1fe6 Merge pull request #68 from mitchellh/window-abs
Enable alternate windowing runtimes
2022-12-30 15:40:24 -08:00
Mitchell Hashimoto
b502d5aa7d apprt: window size limits 2022-12-30 15:36:25 -08:00
Mitchell Hashimoto
d5895f9034 rename windowing_system to just window 2022-12-30 15:32:36 -08:00
Mitchell Hashimoto
0e73c5eb93 apprt: clipboard 2022-12-30 15:29:36 -08:00
Mitchell Hashimoto
8907104e7c comments 2022-12-30 15:22:18 -08:00
Mitchell Hashimoto
71355ada31 window should reach into glfw for addWindow for now 2022-12-30 15:20:45 -08:00
Mitchell Hashimoto
ba0cbecd79 core window doesn't have reference to glfw window anymore! 2022-12-30 15:18:32 -08:00
Mitchell Hashimoto
fe84686a1d apprt: all mouse callbacks 2022-12-30 15:15:54 -08:00
Mitchell Hashimoto
8196481dda apprt: couple more easy callbacks 2022-12-30 14:47:31 -08:00
Mitchell Hashimoto
946383eb77 apprt: key/charCallback, input supports all glfw keys 2022-12-30 14:45:03 -08:00
Mitchell Hashimoto
ff1f1d8925 move the size callback into apprt 2022-12-30 13:33:19 -08:00
Mitchell Hashimoto
41399b6871 renderer: make Metal apprt-aware 2022-12-29 15:14:59 -08:00
Mitchell Hashimoto
11a3577ef1 rename window package to apprt 2022-12-29 15:11:03 -08:00
Mitchell Hashimoto
e1cd650245 window: abstract more, it starts 2022-12-29 14:51:56 -08:00
Mitchell Hashimoto
6eb5a0238a window: start abstracting a window implementation 2022-12-29 14:37:18 -08:00
Mitchell Hashimoto
e253d12a7d update zig 2022-12-28 20:23:53 -08:00