38 Commits
Author SHA1 Message Date
Josh Triplett 0eeca0adfb wezterm-dynamic: Allow unreachable code in macro for infallible conversion (#8364)
The macro impl of `FromDynamic` can have unreachable error paths for
types that have infallible conversions from i64/u64 (i.e. i64 & u64).
2026-11-20 06:26:25 +01:00
Mateusz Mikuła 0f4b5596a5 wezterm-dynamic: Remove deprecated macro_use 2026-09-05 17:54:22 +02:00
xtqqczze 092dcf70d8 style: Add newline after inner attribute for readability (#8130)
Add a newline after inner attributes to make it clear that the
attribute applies to the enclosing item rather than the following item.
2026-09-05 15:31:29 +02:00
Benoit de Chezelles e723cf5005 docs: fix typo 👀 2026-08-10 04:35:11 +02:00
Benoit de Chezelles ad5abbaf21 docs(internal): Add README for wezterm-dynamic 2026-08-10 02:37:04 +02:00
Wez Furlong 75df5e24d9 cargo fix 2025-10-05 10:58:00 +01:00
Rebecca Turner bf9a2aeeba Fix mismatched_lifetime_syntaxes warnings
Fixes a bunch of warnings like this:

```
warning: hiding a lifetime that's elided elsewhere is confusing
   --> window/src/os/macos/window.rs:670:23
    |
670 |     fn display_handle(&self) -> Result<DisplayHandle, HandleError> {
    |                       ^^^^^            ------------- the same lifetime is hidden here
    |                       |
    |                       the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
670 |     fn display_handle(&self) -> Result<DisplayHandle<'_>, HandleError> {
    |                                                     ++++
```

This lint was added in Rust 1.89: https://github.com/rust-lang/rust/issues/141787
2025-09-09 07:05:12 -07:00
Wez Furlong 2b15e46421 refactor: extract wezterm-surface from termwiz 2025-05-10 15:07:21 -07:00
Wez Furlong 47b6410f8f accommodate more no_std builds 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
Wez Furlong edcdefda3b workspace-ify the deps
There have been a couple of attempts at this in the past, which
had some usability warts in what I recall as an earlier, less
useful set of features overall.

Whether that was collective misunderstanding at the time, or things
have gotten better since then, now is a good time to adopt the workspace
dep syntax, because wezterm has many crates to keep on top of, and
automation like dependabot can't see a lot of them.

This will help to manage the versions of deps in wezterm centrally.

Let's try this out in CI: the Cargo.lock changes here are minimal
(eliminated a second version of base64 from one crate, terminal_size
from another, and removed an explicit dep on serde_derive) so
hopefully this sails through on !linux.

closes: https://github.com/wezterm/wezterm/pull/6668
2025-02-12 09:43:36 -07:00
Wez Furlong 4506a7648e dynamic: bump version for publish 2025-02-10 08:46:14 -07:00
Wez Furlong 4d3911b5e2 termwiz: prep for making a new release 2025-02-10 08:45:17 -07:00
Wez Furlong 11c4b11669 s,wez/wezterm,wezterm/wezterm,
I moved the repo to an org of its own. Update various things
to reference the new location.
2025-02-07 13:08:01 -07:00
Martin von Zweigbergk 4bf0007cef add a few missing license files
I didn't symlink to the license file in the root because it mentions
license that don't seem to apply to the crates I added license files
to here.

I used the year each directory was created as the first copyright
year.

I didn't add license files to all crates because I don't need them for
what I'm working on right now, and I want to avoid having to figure
out which licenses apply to which crates.

#2347
2025-01-24 15:40:57 -07:00
Wez Furlong 4906789a6d rustfmt 2024-11-29 15:21:48 -07:00
Wez Furlong 74015a95c7 fix some warnings with rust 1.83
It's complaining about non-local impls and elided lifetimes
that have names.

I don't recall why I thought I needed these "dummy" enclosing
scopes, and they are most likely cargo-cult copypasta from
some other derive implementation that I used as inspiration.
2024-11-28 21:32:15 -07:00
Wez Furlong 723f062d0d deps: update strsim 2024-05-13 12:20:09 -07:00
Wez Furlong f472a5abfb wezterm-dynamic: bump version of crates.io publish
Not sure if it is strictly necessary to do this, but stuff
has changed since the last publish.
2024-01-27 12:09:16 -07:00
Wez Furlong 7590968257 fix a couple of new redundant clone warnings in rust 1.73 2023-10-30 07:45:59 -07:00
Wez Furlong c75f20f21c deps: ordered-float -> 4.1.0
closes: https://github.com/wez/wezterm/pull/4338
2023-09-28 14:39:22 -07:00
Jalil David Salamé Messina d541e2e13d fix(clippy): Remove closures where possible
- Removes closures and function calls for types that implement default:

  ```rust
  // Change
  let _my_str = get_str().unwrap_or(String::new);
  // To
  let _my_str = get_str().unwrap_or_default();
  ```

- Uses the `.cloned()/.copied()` methods where possible
- Use function pointer instead of simple closure

May improve performace, as closures generate more code, and this might
unlock some inlining opportunities.
2023-03-19 08:41:38 -07:00
Jalil David Salamé Messina c6dc38b7f3 fix(clippy): Derive Default where possible 2023-03-15 10:21:11 -07:00
Wez Furlong 6f62a0f2b1 config: capture warnings and show them in config error window
This allows deprecated and invalid fields to be surfaced more visibly
in the config error window.
2023-01-24 14:18:15 -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 de466cfa64 config: validate consistency of domain names
refs: https://github.com/wez/wezterm/issues/2618
2022-10-11 06:59:12 -07:00
Wez Furlong da13cf69fa docs for activate-pane-direction
* Enhance usage info in `wezterm cli activate-pane-direction --help` by
  showing the variants.
* Update shell completions
* docs and changelog entry
2022-09-20 08:50:46 -07:00
Davide Cavalca 0048209bcf Add missing license files 2022-08-17 07:19:12 -07:00
Wez Furlong 355b6d835b prep for publishing wezterm-bidi and wezterm-dynamic to crates.io 2022-08-01 18:35:56 -07:00
Wez Furlong a1cb7a2a88 dynamic: add validate attribute, validate line_height.
It's now possible to specify a validation function for config
items.

Use that to validate line_height:

```
; ./target/debug/wezterm --config line_height=-1
08:41:10.576  ERROR  wezterm > Error converting lua value from overrides to Config struct: Error processing Config::line_height: Illegal value -1 for line_height; it must be positive and greater than zero!; terminating
```

refs: https://github.com/wez/wezterm/issues/2247
2022-07-12 08:41:42 -07:00
Wez Furlong 10b558fae2 dynamic: handle ambiguous {} object vs. array case centrally 2022-07-07 15:42:14 -07:00
Wez Furlong f2627bc39e ActivateKeyTable replace_current wasn't actually optional
The issue here was that the from_dynamic impl derived for a struct
that was inlined in an enum didn't respect the the field properties
defined for the struct.

Refactor to reuse the same field_info helper used by the struct
code.

Update docs to clarify what the default value actually is.

refs: https://github.com/wez/wezterm/issues/2179
2022-06-25 19:38:39 -07:00
Wez Furlong da7da888cd config: generate errors for things like --config tarm=foo
Invalid option names, or values that evaluate as nil (such as the `foo`
above: that's treated as a global variable reference, but `foo` isn't a
defined global and evaluates as `nil`) will now cause the program
startup to error out with an actionable error message.

Previously, the invalid config name would generate a warning, and the
invalid value would silently have no effect as it has the same effect as
omitting the named value and leaving it as its default value.

I think these cases should both immediately error out and stop
further processing, so that's what we're doing.

This commit also adds support for adding:

```
   #[dynamic(deprecated = "use newer option instead")]
   pub some_config_value: bool,
```

but not options currently use this.
2022-05-21 13:10:30 -07:00
Wez Furlong 94039c473b dynamic: allow defaulting to None for enum struct fields
refs: https://github.com/wez/wezterm/issues/1993#issuecomment-1133283042

```
DISPLAY=:0 ./target/debug/wezterm -n --config 'keys={{key="a", mods="NONE", action=wezterm.action{SwitchToWorkspace={ name = "default"}}}}'
```
2022-05-20 13:38:24 -07:00
Wez Furlong d6063e180a config: fix specifying numeric font weights
add helpers to Value coerce to different numeric types, and use
one of those in the FontWeight conversion.

refs: #2012
2022-05-20 06:33:12 -07:00
Wez Furlong 42a7c1d481 dynamic: improve error messaging 2022-05-18 13:39:51 -07:00
Wez Furlong c7387490a6 dynamic: add some doc comments 2022-05-18 09:54:02 -07:00
Wez Furlong 24c6830345 add wezterm-dynamic crate 2022-05-18 07:47:39 -07:00