Commit Graph
8 Commits
Author SHA1 Message Date
Wez Furlong 6740628da5 refactor: extract wezterm-cell from termwiz 2025-05-10 15:07:21 -07:00
Wez Furlong 0cd3fe8f97 wezterm-escape-parser: allow building no_std (but with alloc)
This commit makes a number of parts of wezterm's core
parsing functionality no_std compatible, but requiring alloc.

In the no_std environment, several lookup tables that would
normally have been used to accelerate some operations are
not available and we instead fall back to an O(n) operation.
2025-05-10 15:07:20 -07:00
Jun Wu b4261af93e termwiz: make image support optional with a Cargo feature
The `image` module introduces some extra dependencies that seem a bit
heavyweight. This change adds an `image` Cargo feature to make related
features optional.

    ├── sha2 v0.10.8
    │   ├── cfg-if v1.0.0
    │   ├── cpufeatures v0.2.17
    │   └── digest v0.10.7
    │       ├── block-buffer v0.10.4
    │       │   └── generic-array v0.14.7
    │       │       └── typenum v1.18.0
    │       └── crypto-common v0.1.6
    │           ├── generic-array v0.14.7 (*)
    │           └── typenum v1.18.0
    └── wezterm-blob-leases v0.1.1
        ├── getrandom v0.3.1
        │   ├── cfg-if v1.0.0
        │   └── libc v0.2.170
        ├── mac_address v1.1.8
        │   └── nix v0.29.0 (*)
        ├── sha2 v0.10.8 (*)
        ├── thiserror v1.0.69 (*)
        └── uuid v1.15.1
            ├── atomic v0.6.0
            │   └── bytemuck v1.22.0
            └── getrandom v0.3.1 (*)

The `image` feature is default on to maintain compatibility.

Test Plan:

    cargo check --no-default-features
    cargo check
2025-04-12 22:05:40 -07:00
Wez Furlong 7b40f01054 switch to fancy-regex crate
Enables back references and look around assertions for quick select
and hyper link rules

refs: https://github.com/wez/wezterm/issues/3247
2023-04-07 17:39:00 -07:00
Wez Furlong 7cd0cc21bf ImageDataType::File -> EncodedLease
Adopt the new blob lease layer to storing and referencing
image files.

This reduces the number of open files needed when
images are being displayed in the terminal.

refs: https://github.com/wez/wezterm/issues/3263
2023-03-18 20:32:49 -07:00
Wez Furlong aa929a1a9b move animation decoding from term layer to gui layer
This makes decoding animation frames a lazy operation, but it
comes at the cost of needing to re-decode the image from scratch
when it loops, because the image crate doesn't provide a way
to rewind its frame iterator.

That initial decode can have a significant time cost; a small
webp file consistently takes 150ms to decode, which is too
much to do inline in the render thread.

Next steps will be to move that cost off the render thread.
2023-03-17 11:41:20 -07:00
Wez Furlong f78190ec9c filedescriptor: remove anyhow from public interface
Use thiserror instead
2021-05-23 14:24:01 -07:00
Wez Furlong 5d360ae365 termwiz: Remove anyhow::Result from public API
It's been replaced with an opaque termwiz error type instead.

This is a bit of a more conservative approach than that in (refs: #407)
and has less of an impact on the surrounding code, which appeals to
me from a maintenance perspective.

refs: #406
refs: #407
2021-01-08 00:32:30 -08:00