ba309931a3146a007bd46cf3a5e51abe03ba5364
This slightly improves the startup time of wezterm. Right now we query the portal appearance value again over dbus every time that we access it, for example every time that the user calls wezterm.gui.get_appearance() from the Lua interface. Queries over dbus are slow, they usually take a few milliseconds to complete, for example on my system a portal query over dbus takes around 2 milliseconds to complete. Wezterm also automatically calls the portal during its own internal x11/wayland connection initialization, thus right now wezterm queries the appearance portal setting n+1 times on startup, where n is the number of times that the user calls get_appearance() from the config. To fix this problem, we simply cache the portal appearance. Thus this patch decreases the startup time by 2ms for users that configure wezterm to follow the global system theme and potentially by more for users that call get_appearance() in inflational amounts. With the naive implementation wezterm would be subject to the following race condition: 1. wezterm calls get_appearance() and caches the value 2. System-wide dark mode changes 3. wezterm subscribes to portal notifications In that scenario wezterm would miss the dark mode switch entirely and would cache the wrong value until the dark mode switches again after wezterm subscribed. To fix this race condition we call read_setting() again **after** we have subscribed just to be on the safe side. Note that while this still introduces a second "redundant" dbus query for the same value, this time it does not actually block start up since it happens in another thread. refs: #2258
Wez's Terminal
A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
User facing docs and guide at: https://wezfurlong.org/wezterm/
Screenshot of wezterm on macOS, running vim
Installation
https://wezfurlong.org/wezterm/installation.html
Getting help
This is a spare time project, so please bear with me. There are a couple of channels for support:
- You can use the GitHub issue tracker to see if someone else has a similar issue, or to file a new one.
- Start or join a thread in our GitHub Discussions; if you have general questions or want to chat with other wezterm users, you're welcome here!
- There is a Matrix room via Element.io for (potentially!) real time discussions.
The GitHub Discussions and Element/Gitter rooms are better suited for questions than bug reports, but don't be afraid to use whichever you are most comfortable using and we'll work it out.
Supporting the Project
If you use and like WezTerm, please consider sponsoring it: your support helps to cover the fees required to maintain the project and to validate the time spent working on it!
Description
The agentic terminal: a WezTerm fork with LLeMbas built in
316 MiB
0 Stars
2 Watchers
0 Forks
Languages
Rust
97.7%
Python
1%
Shell
0.9%
Nix
0.2%
