1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-19 11:21:39 +03:00
Commit Graph

6457 Commits

Author SHA1 Message Date
Wez Furlong
eaa91e9314
deps: update raw-window-handle 2022-11-18 10:03:49 -07:00
Wez Furlong
35e3e30d7a
docs: add_wsl_distributions_to_launch_menu was removed
Update WSL related info to reflect its removal and note about
how to achieve the same effect as turning it off.

refs: #2750
2022-11-17 06:29:41 -07:00
Wez Furlong
35fd69b0d5
partially handling overflowing tab titles
The recent changes to clustering make this more likely to happen.
This doesn't handle overflow resulting from changing styles in the tab
title, but those are less common.

refs: https://github.com/wez/wezterm/issues/2560
2022-11-15 15:38:45 -07:00
Wez Furlong
62e2e996da
changelog for https://github.com/wez/wezterm/pull/2746
closes: https://github.com/wez/wezterm/issues/2667
2022-11-15 09:44:44 -07:00
Xeysz Matrasx
c55cecaee5 Allow windows installer to run on arm64 emulating x64 2022-11-15 08:41:18 -08:00
Wez Furlong
387d0ad3e3
rustdoc markdown fences-- 2022-11-15 09:40:10 -07:00
Wez Furlong
9569028d98
xcursor: parse and follow theme inheritance
A couple of users ran into an issue where wezterm couldn't find
their mouse cursor icons.

Looking more deeply into this, we weren't looking at `index.theme`
files and following the inheritance chain from them.

This commit addresses that!

refs: https://github.com/wez/wezterm/issues/2687
refs: https://github.com/wez/wezterm/issues/2743
2022-11-15 09:15:43 -07:00
Wez Furlong
30daed40b3
reduce size of BoxedQuad by 2/3
Since we're no longer tied to contiguous Vertex slices, we can
record the Quad data used for HeapQuadAllocator in a smaller structure,
so that's what this does.

It reduces the per-Quad storage from 272 bytes down to 84 bytes,
which helps with overall memory usage: the default cache size is 1024
lines worth of quads, so this can add up to multiple MB of RAM.

refs:  https://github.com/wez/wezterm/issues/2626
2022-11-14 23:11:02 -07:00
Wez Furlong
a852e47dba
quads: switch to allocating quads rather than contiguous vertices
This reduces peak heap usage by several MB by making better use
of allocated memory--no wasted overhead in the Vec capacity.

refs: https://github.com/wez/wezterm/issues/2626
2022-11-14 14:44:25 -07:00
Wez Furlong
84e2501df2
remove dead code 2022-11-14 13:47:38 -07:00
Wez Furlong
173e27d2e8
Add support for heap profiling using dhat
refs: https://github.com/wez/wezterm/issues/2626
2022-11-14 13:26:02 -07:00
Wez Furlong
831eda86b9
perf: adjust clustering when bidi is disabled
When a line is rapidly updated with only some of the cells being
actually changed (eg: progress counter or other status being frequently
updated), it is desirable to avoid paying the cost of shaping the entire
line.

When bidi is not enabled we can assume that it is safe to break clusters
on whitespace boundaries. Doing so allows each of those whitespace
separated words to be shaped and potentially cached independently,
which reduces the amount of CPU time spent for the whole line.

This commit just adjusts the clustering, which reduces the CPU
utilization a bit.

refs: https://github.com/wez/wezterm/issues/2701
2022-11-14 10:05:20 -07:00
Wez Furlong
0516b61f62
lfucache: improve LFU algorithm and structure
Do it "more properly": use intrusive list linkage to manage three
indices:

* hash lookup
* recency
* frequency

eviction is frequency based, but in order to avoid things that were
super hot in the past and that are no longer hot clogging up the cache,
eviction will incrementally age out least recently used entries that
haven't been active in the span of some number of get/put operations.

Aging scales down the frequency value to reduce its strength, so an aged
item isn't necessarily immediately a candidate for removal, it just
makes it more likely to be picked up by the frequency based removal as
it goes unused for an extended period.
2022-11-14 10:00:49 -07:00
Wez Furlong
72757b8849
refactor: move lfucache into its own crate 2022-11-14 07:35:37 -07:00
Wez Furlong
36f215c03e
cargo update 2022-11-13 18:24:31 -07:00
Wez Furlong
38ab42b5bf
docs: remove wezterm-nightly-bin AUR link
I plan to retire that as it has ABI compatibility issues on arch

refs: https://github.com/wez/wezterm/issues/2712
2022-11-13 17:09:52 -07:00
Wez Furlong
1c8a20d577
gui: fix cursor color invalidation issue
Things like compose cursor and dynamically changed cursor colors
were not factored into our cache keys, making the cursor color
"sticky" in the wrong ways.

refs: https://github.com/wez/wezterm/issues/2708

Might possibly also help with https://github.com/wez/wezterm/issues/2635
2022-11-13 16:47:34 -07:00
Wez Furlong
274b1819a1
Fix horizontal wheel events
refs: https://github.com/wez/wezterm/issues/2649
2022-11-13 08:58:35 -07:00
Wez Furlong
d7c3d7bce3
docs for #2702 2022-11-13 06:25:49 -07:00
Wez Furlong
c71e22e57d keyevent: fixup prevent_fallback processing
refs: #2702
2022-11-07 09:36:25 -07:00
Wez Furlong
de7f5e566a docs: changelog for #2112
refs: https://github.com/neovim/neovim/issues/20706
refs: #2112
2022-11-06 21:07:48 -07:00
Wez Furlong
4ed2fd8e94 wezterm.terminfo: add statusline entries
nvim uses these to set the title string; really, it is setting the
status line, but it has an assumed fallback for xterm that redefines the
status line update operations in terms of setting the title of the xterm
window.

Let's ensure that our terminfo has these entries defined, as the nvim
fallback currently looks for `xterm` in the value of $TERM to decide
whether the fallback is appropriate, and that test does not pass when
the user has set term=wezterm.

refs: https://github.com/neovim/neovim/issues/20706
refs: https://github.com/wez/wezterm/issues/2635

See also: https://codeberg.org/dnkl/foot/pulls/243/files,
https://codeberg.org/dnkl/foot/issues/242,
https://github.com/alacritty/alacritty/issues/1636
2022-11-06 20:57:58 -07:00
Wez Furlong
295a13091a cargo update 2022-11-06 18:51:07 -07:00
Theo Beers
a135f53659 Fix compiler warning 2022-11-05 09:05:35 -07:00
Wez Furlong
6aceb97ded keys: add prevent_fallback option for ActivateKeyTable
The behavior is to prevent falling back to a later key table
if no key matched.

refs: https://github.com/wez/wezterm/issues/2702
2022-11-04 07:02:36 -07:00
Wez Furlong
36903c0a1e docs: changelog for https://github.com/wez/wezterm/pull/2670
refs: https://github.com/wez/wezterm/issues/2622
refs: https://github.com/wez/wezterm/issues/2271
2022-11-04 06:37:18 -07:00
Magnus Groß
e3a320eec0 Continue parsing cmdline arguments in the desktop file
In a56904e40d the desktop file was patched
to use "wezterm start" instead of "wezterm". As an unneeded addendum
that patch also included the unnecessary addition of ending command-line
parsing by passing the "--" option at the end.

As it turns out, some consumers of wezterm's desktop file want wezterm
to parse command line flags. For example KDE's kio passes the whole
cmdline via the "-e" flag, because it is widely used for most terminal
emulators as the primary mean of passing the cmdline.

To solve this we remove the unneeded "--" again, because we now also
support the "-e" option.
After all, all trailing arguments will automatically be parsed by
wezterm as the cmdline of the program to run.
The only sideeffect of this change is that we now cannot longer start
programs that share a name with a "wezterm start" option, for example if
the user has installed an executable at /usr/bin/--always-new-process
then this edge case will not work anymore.
Given that this would be an extremely unlikely scenario, it makes more
sense to improve compatibility by supporting the usecase of passing the
cmdline with the "-e" flag.

refs: #2622
refs: #2271
refs: https://bugs.kde.org/show_bug.cgi?id=459616
2022-11-04 06:32:32 -07:00
Magnus Groß
0d4cd8a1e0 Allow to pass the command to execute via "-e"
Right now wezterm already allows to pass a cmdline to execute (instead
of the shell) by calling "wezterm start" with trailing arguments, e.g.
wezterm start -- bash

However, most other terminals implement this via a "-e" option. This
seems to be adopted widely in the wild, such that some third-party
frameworks just blindly expect the user's terminal to use the "-e"
option for this.

One such notable framework is kio from KDE Plasma, that calls the user's
terminal in that way when launching a desktop file that uses
Terminal=true. [1]

To solve this problem, we add a compatibility layer by adding a dummy
"-e" option. This will then consume the "-e" leaving the remaining
arguments as trailing arguments, which will later be consumed by our
existing implementation in the "prog" option.

Given that clap does not really support multiple arguments writing to
the same destination [2], this seems like the most sane implementation,
even if it is a hack.

It seems to work reliable, even for edge cases where we pass wezterm
options as trailing arguments, e.g. the following will just work and do
the expected outcome (and will **not** parse "--position" as a wezterm
argument):
wezterm start -e echo --position 10,10

Fixes #2622

[1] https://bugs.kde.org/show_bug.cgi?id=459616
[2] https://github.com/clap-rs/clap/issues/3146
2022-11-04 06:32:32 -07:00
Wez Furlong
40e08fafe2 rust 1.65 does a better job with enum packing
so adjust test expectations

refs: https://github.com/wez/wezterm/pull/2700
2022-11-03 19:57:02 -07:00
Wez Furlong
a6fc9323e2 termwiz: release 0.19 2022-11-02 08:16:09 -07:00
Jonathan LEI
4df6d2a477 fix: temp fix for Android build error 2022-11-02 08:08:35 -07:00
Wez Furlong
8dfc5e81a9 deps: cargo update for openssl 2022-11-01 18:09:23 -07:00
Wez Furlong
0ee0243a8c deps: cargo update 2022-11-01 07:09:37 -07:00
Wez Furlong
f726a2075e deps: remove async-std dep
We were only using block_on from it, which we can call from the
underlying async_io crate.

Notably, removing async_std from the deps avoids async-global-executor
being pulled in and spawning nproc threads that are never used by
wezterm.
2022-11-01 07:05:33 -07:00
Wez Furlong
43f2265ef1 deps: textwrap -> 0.16
closes: https://github.com/wez/wezterm/pull/2664
2022-10-23 20:50:47 -07:00
Wez Furlong
7063cba250 cargo update 2022-10-23 12:08:11 -07:00
Wez Furlong
b1faba9d8a deps: upgrade finl_unicode to 1.2 2022-10-23 12:07:00 -07:00
Wez Furlong
cd386804c4 macos: remove UNHANDLED: IME: do_command_by_selector warnings
We handle this the same whether we know the selector or not these days,
so just remove the warning.
2022-10-22 20:03:15 -07:00
Wez Furlong
4f05e2e1f1 render: remove redundant extra quad buffer
I can't think of a good reason for this being here.  I think I
may have been lazy about resolving the lifetime annotations
and just stuck in an extra buffer while building the original
version of this logic, and then forgot about it.

This commit resolves the lifetime annotations and directly
references the passed in buffer.

refs: https://github.com/wez/wezterm/issues/2626
2022-10-22 19:51:52 -07:00
Wez Furlong
35ce2fe74d trim heap usage
I spent a few hours in heap profilers.  What I found was:

* Inefficient use of heap when building up runs of
  `Action::Print(char)`.
    -> Solve by adding `Action::PrintString(String)`
  and accumulating utf8 bytes rather than u32 codepoints.
* Inefficient use of heap when building Quad buffers: the default
  exponential growth of `Vec` tended to waste 40%-75% of the allocated
  capacity, and since we could keep ~1024 of these in cache, there's
  a lot of potential for waste.
   -> Solve by bounding the growth to 64 at a time.  This has similar
   characteristics to exponential growth at the default 80x24 terminal
   size.  May need to add a config option for this step size for users
   with very large terminals.
* Lazy eviction from the LFU caches. The underlying cache advisor is
  somewhat probabilistic and has a minimum cache size of 256, making
  it difficult to maintain low heap utilization.
   -> Solve by replacing it with a very simple LFU algorithm. It doesn't
   seem to hurt much at the default terminal size with the default
   cache sizes.  If we make the cache sizes smaller, its overhead is
   reduced.

Some further experimentation is needed to adjust defaults, but this
should help reduce heap usage.

refs: https://github.com/wez/wezterm/issues/2626
2022-10-22 17:10:36 -07:00
Wez Furlong
5dd1f513f9 reduce log level strength of "breaking on overflow" 2022-10-22 06:26:10 -07:00
Wez Furlong
287a633a98 ci: maybe fix suse CI
looks like lsb-release is no longer a valid package in suse
2022-10-21 21:47:09 -07:00
Wez Furlong
a7465228bb update cargo.lock for bidi release 2022-10-21 21:46:50 -07:00
Wez Furlong
92075d31b3 bidi: bump version for publish 2022-10-21 20:53:29 -07:00
Wez Furlong
cc4a155a4a update harfbuzz to 5.3.1
it includes a fix for shaping grapheme clusters for Katakana voiced
sound marks.

refs: https://github.com/wez/wezterm/issues/2572
2022-10-19 20:00:13 -07:00
Wez Furlong
f2b0ce7d2e mux client: add a warning 2022-10-18 08:22:51 -07:00
Wez Furlong
ec4d5eb1d5 gui: set up mux socket for wezterm connect case as well
It can be helpful for debugging purposes.
The socket can be discovered by setting:

WEZTERM_LOG=wezterm_mux_server_impl::local=trace,info

to get it to log a line like:

```
setting up /Users/wez/.local/share/wezterm/gui-sock-38183
```

Then it can be helpful to do:

```
WEZTERM_UNIX_SOCKET=/Users/wez/.local/share/wezterm/gui-sock-38183 wezterm cli list
```

to see what is in the gui's mux model.

refs: https://github.com/wez/wezterm/issues/2616
2022-10-17 20:45:32 -07:00
Wez Furlong
ac1413a99a fix panic with window:set_workspace when default domain is mux
refs: https://github.com/wez/wezterm/issues/2638
2022-10-17 07:06:43 -07:00
Wez Furlong
84de038d5d bidi: move conformance tests to separate file
this is so that we can exclude it from the published crate

8b32ed483a
2022-10-16 21:07:33 -07:00
Wez Furlong
62cbcd691d cargo update 2022-10-16 20:57:48 -07:00