Commit Graph
559 Commits
Author SHA1 Message Date
Wez Furlong 09f1ecbf82 erase generic T from Atlas, Sprite, CachedGlyph etc.
This will make it easier to use the same impl for webgpu and opengl
for a bunch of this stuff.
2022-11-18 10:03:49 -07:00
Wez Furlong 8479be7465 Basic useless wgpu based rendering foundation 2022-11-18 10:03:49 -07:00
Wez Furlong eaa91e9314 deps: update raw-window-handle 2022-11-18 10:03:49 -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 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 295a13091a cargo update 2022-11-06 18:51:07 -07:00
Wez Furlong a6fc9323e2 termwiz: release 0.19 2022-11-02 08:16:09 -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 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 a7465228bb update cargo.lock for bidi release 2022-10-21 21:46:50 -07:00
Wez Furlong 62cbcd691d cargo update 2022-10-16 20:57:48 -07:00
Wez Furlong 7b904f05eb termwiz: fixup for 32-bit systems
I noticed from https://github.com/void-linux/void-packages/pull/36903
that 32-bit systems were failing to pass the test suite.

Running `cargo test --target i686-unknown-linux-gnu  -- --nocapture
teeny_string` showed that we were faulting in the teenystring code
and digging a bit deeper showed that it was because our assumptions
about the high bits were wrong for 32-bit systems.

Fix this by making TeenyString based around a u64 rather than usize
so that we guarantee its size on all current systems.
2022-10-15 16:45:02 -07:00
Wez Furlong cb31c35b99 cargo update 2022-10-09 20:26:07 -07:00
Wez Furlong 4e5945c061 Add ResetTerminal and pane:inject_output method
refs: https://github.com/wez/wezterm/discussions/2606
2022-10-08 10:25:22 -07:00
Wez Furlong 2cae10016f deps: update emojis crate 2022-10-04 09:00:18 -07:00
Wez Furlong a050849695 deps: update to clap 4
Deal with some breaking changes
2022-10-04 08:55:31 -07:00
Wez Furlong ba57f73bd9 deps: pick up updated rust-xcb
Might help with these:

refs: https://github.com/rust-x-bindings/rust-xcb/issues/195
refs: https://github.com/wez/wezterm/issues/2559
refs: https://github.com/rust-x-bindings/rust-xcb/issues/204
2022-10-04 07:53:46 -07:00
Wez Furlong 206f45acfc cargo update 2022-10-04 07:44:55 -07:00
Wez Furlong 9be0595164 cargo update 2022-09-27 07:11:12 -07:00
Wez Furlong 8508860136 config: derive some metadata about the config
This isn't used by anything yet, but will enable some runtime
config editing functions that I have planeed for the future.
2022-09-22 06:09:31 -07:00
Wez Furlong c91d6c396c termwiz: prepare for a 0.18.0 release 2022-09-21 19:20:26 -07:00
Wez Furlong a59e45ab9e cargo update 2022-09-18 20:00:54 -07:00
Wez Furlong 8d2a3cf7f1 deps: cargo update 2022-09-16 07:48:12 -07:00
Wez Furlong 85db555b37 deps: update finl_unicode 2022-09-16 07:47:33 -07:00
Wez Furlong 243653911a update Cargo.lock for bidi update 2022-09-15 06:30:33 -07:00
Wez Furlong fe78b5821f cargo update 2022-09-12 06:26:10 -07:00
Wez Furlong 96c4e7e9b9 Switch to finl_unicode for grapheme clustering
According to its benchmarks, it's almost 2x faster than
unicode_segmentation.  It doesn't appear to make a visible
difference to `time cat bigfile`, but I'll take anything
that gives more headroom for such little effort of switching.
2022-09-10 07:15:49 -07:00
Wez Furlong c1cfa54b61 cargo update 2022-09-05 07:36:58 -07:00
Wez Furlong 587b0e50ff cargo update 2022-09-03 18:58:35 -07:00
Wez Furlong 804fc04630 deps: xkbcommon-rs released 0.5
can stop using my git repo for this
2022-09-02 09:25:20 -07:00
Wez Furlong 1b9ea2de3f change text cursor to fa_lock when entering passwords
There are caveats to determining this, but when we think
password entry is enabled, switch the cursor to the font-awesome
lock glyph instead of the normal cursor sprite.

fa_lock is used because it is monochrome and can thus be tinted
to the configured cursor color, and it respects blinking/easing.

refs: https://github.com/wez/wezterm/issues/2460
2022-09-02 09:00:28 -07:00
Wez Furlong 14c613a064 add Pane::get_metadata
The idea here is that different kinds of panes may want to expose
additional metadata to lua scripts. It would be a bit weird to add
a Pane method for each of those and plumb it all the way through
the various APIs, so just allowing a pane impl to return a dynamic
value (likely an Object) allows a bunch of flexibility.

This commit exposes the clientpane is_tardy boolean and the time
since the last data was recevied (since_last_response_ms) from
the mux client pane implementation: these are used to show the
tardiness indicator in the client pane.

Exposing this data enables the user to add that info to their
status bar if they wish.
2022-09-01 21:27:49 -07:00
Wez Furlong 7670c4f0ae char selector: track recently selected emoji and use frecency to show it
refs: https://github.com/wez/wezterm/issues/2163
2022-08-31 22:56:58 -07:00
Wez Furlong ed731a0d8d Add CharSelect modal for emoji/nerdfont/unicode input
CTRL-SHIFT-U is a new default key assignment for this new modal.
It opens up a fuzzy searchable browser that defaults to showing
emoji/emoticons.  The category can by cycled through the suggested
emoji categories using CTRL-r.  Unlike the system emoji palette,
wezterm includes a category for nerdfont symbols, and another
that is a list of all unicode codepoint names, so you should be
able to browse for pretty much any codepoint you can think of.

The modal also allows fuzzy searching based on:

* The official unicode name
* The github shortcode
* codepoint value in hex

so if you know the codepoint value but not the name, you can
still find a way to input what you're looking for.

Pressing Enter will copy the selected item to the clipboard
send it to the active pane, and cancel the modal. You can therefore
repeat the insert by simply pasting.

I plan to add frecency to this in a later commit: that way the
frequently/recently used selections will show in a category of
their own and make it easier to re-input them.

refs: https://github.com/wez/wezterm/issues/2163
2022-08-31 18:15:28 -07:00
Wez Furlong b9d0843b71 deps: tiny-skia 0.7 -> 0.8 2022-08-28 20:50:27 -07:00
Wez Furlong 0f0593f475 cargo update 2022-08-28 20:48:33 -07:00
Wez Furlong 9732f9ee2b Adjust render caching; switch to LFU caches from LRU 2022-08-28 10:28:26 -07:00
Wez Furlong 0702a7163e cargo update 2022-08-21 19:59:34 -07:00
Wez Furlong 7be824db62 deps: update zbus 2022-08-21 09:18:32 -07:00
Wez Furlong de89d650a3 cargo update 2022-08-21 08:51:16 -07:00
grant0417 f792a20f7a Add fig to shells for shell completion 2022-08-21 08:33:19 -07:00
Wez Furlong f2ee48bdff cargo update 2022-08-14 22:27:23 -07:00
Wez Furlong e6421d1b72 pty: try_clone_writer -> take_writer
This breaking API change allows us to explicitly generate EOF when the
taken writer is dropped.

The examples have been updated to show how to manage read, write
and waiting without deadlock for both linux and windows.
Need to confirm that this is still good on macOS, but my
confidence is high.

I've also removed ssh2 support from this crate as part of this
change. We haven't used it directly in wezterm in a long while
and removing it from here means that there is slightly less code
to keep compiling over and over.

refs: https://github.com/wez/wezterm/discussions/2392
refs: https://github.com/wez/wezterm/issues/1396
2022-08-12 07:56:46 -07:00