Commit Graph
132 Commits
Author SHA1 Message Date
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
mgpinf 0f21892bb5 add last_row in get_text_from_semantic_region
This commit adds the last row into account while
computing the get_text_from_semantic_region
2025-02-23 05:22:57 -08: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 44866cc137 new: ConEmu progress reporting OSC sequence
This commit parses and captures the progress state as set by
ConEmu style progress reporting escape sequences.

Changes to the state will propagage through the mux via the
existing MuxNotification Alert system, and should also transit
across multiplexer connections.  However, there is no separate
multiplexer state transfer for the progress state, so reconnecting
to a mux in the middle of a progress sequence will show as None
for the progress state, until the next update occurs.

Aside from propgating and exposing the state to lua via PaneInformation
and a Pane::get_progress method, wezterm doesn't do anything with
the progress information at this time.

This commit includes an example of how you might customize your
tab title to reflect the progress in the active pane.

refs: https://github.com/wezterm/wezterm/issues/6581
2025-02-09 18:26:23 -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
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
joncrangle ab9b9d9423 Remove trailing sZs if exists 2024-09-14 11:30:51 -07:00
Wez Furlong 56a27e93a9 cargo update
plus some noise around the image crate api evolving and deprecating
some type aliases.
2024-07-30 08:27:27 -07:00
Wez Furlong 2a068cacb7 deps: update terminfo 2024-05-13 12:29:19 -07:00
Wez Furlong 944e0b29b6 deps: update to new filenamegen 2024-05-13 11:19:33 -07:00
Wez Furlong 1ca5e6cc90 deps: upgrade smol to 2.0 2024-05-13 10:26:29 -07:00
Wez Furlong 281b6e2740 deps: update metrics to a more recent version
This isn't the latest version of metrics; it's just a more recent
version that allows us to remove a duplicate ahash dependency from the
build graph.
2024-05-13 09:41:11 -07:00
Wez Furlong 14d426fea8 add cargo deny config, update lru 2024-05-13 08:29:36 -07:00
Wez Furlong 265b85be1d update image to 0.25
This improves how non-conforming jpegs are decoded and displayed.

refs: https://github.com/wez/wezterm/issues/5365
2024-05-05 16:14:46 -07:00
Wez Furlong cab8523f85 deps: update starship battery 2024-05-04 17:01:24 -07:00
Wez Furlong 85fb1ad210 update deps, in particular git2 2024-02-18 13:38:04 -07:00
cyc f671a9ab97 remove redundant imports. 2024-02-08 08:59:47 -07:00
cyc 8e5957b92f add unit tests for JSON/YAML/TOML parsers. 2024-02-08 08:59:47 -07:00
cyc 8dc4ba7ad1 add *_encode_pretty variants for TOML and JSON. 2024-02-08 08:59:47 -07:00
cyc 8596422abf add YAML/TOML serialization/deserialization feature 2024-02-08 08:59:47 -07:00
Wez Furlong 4f123a461b macos (mostly): try harder to get initial dpi
There are a number of open issues that relate to getting the dpi
wrong when spawning a window. In theory it shouldn't matter because
we will immediately realize the difference and synthesize the correct
information, but evidence shows this isn't quite true.

What this commit does is:

* Override Connection::default_dpi() on macOS to return the
  effective_dpi from the active screen instead of the default
  non-retina dpi
* Adjust the Config::initial_size() method to accept an optional
  cell pixel dimension
* Add a helper function to wezterm-gui to compute the cell pixel
  dimensions given the config and the (usually default) dpi, and
  feed that through to Config::initial_size
* in the macos window impl, scale the computed geometry based on
  the ratio of the Connection::default_dpi and the default non-retina
  dpi.

This helps to avoid needing to do a fixup in the
https://github.com/wez/wezterm/issues/4966 case, and may help with
the various other macos quirky issues.

refs: https://github.com/wez/wezterm/issues/2958
refs: https://github.com/wez/wezterm/issues/3575
refs: https://github.com/wez/wezterm/issues/3900
refs: https://github.com/wez/wezterm/issues/4250
refs: https://github.com/wez/wezterm/issues/4285
refs: https://github.com/wez/wezterm/issues/4447
refs: https://github.com/wez/wezterm/issues/4851
refs: https://github.com/wez/wezterm/issues/4966
2024-02-06 22:57:05 -07:00
Wez Furlong aa81a46d58 mux: allow specifying cache policy for process information
This allows individual call sites to be able to force an immediate
resolution of the process information.

This should help to address https://github.com/wez/wezterm/issues/4811
wherein the problem seems to be that the cwd used for a new spawn
is taken from a stale read.
2024-02-02 18:02:18 -07:00
Wez Furlong dd039402da sync-color-schemes: gogh schema changed slightly 2024-01-27 11:35:26 -07:00
Wez Furlong f30ea0a6eb new: pane:get_lines_as_escapes()
refs: https://github.com/wez/wezterm/issues/4780
2024-01-27 11:22:48 -07:00
mikyk10 24115049f3 fix: changed the criteria to calculate the sunset / sunrise progression 2024-01-19 08:52:17 -07:00
Danielkonge 254034c512 Add wezterm.to_string function 2023-12-03 12:40:28 -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
Wez Furlong bae73d34b5 color-schemes: fix gogh import
The cursor colors in gogh weren't imported quite right; this
fixes things up so that we use the background color together
with the cursor color from the scheme.

refs: https://github.com/wez/wezterm/issues/4257
2023-09-22 14:30:24 -07:00
Wez Furlong b904ed7677 breaking(ish): pane.get_current_working_dir now returns Url
Previously we'd return the Url string.  Now we provide a Url
object that provides access to the various elements of the Url.

This will cause slightly breakage for folks that were treating
it as a string in their status event handlers, for example.

The docs have been updated to show how to run with both this
new Url object and also continue to run on older versions of
wezterm.

They now also show how to manually percent decode the url
for older versions of wezterm.

refs: https://github.com/wez/wezterm/discussions/4157
refs: https://github.com/wez/wezterm/issues/4000
2023-08-25 06:59:09 -07:00
Wez Furlong 6ccbc723ba wezterm.gui.screens: add optional effective_dpi field
This commit implements it for Windows. The other systems
report None for now.
2023-08-06 09:18:40 -07:00
Wez Furlong a07ab883af persist charselect, repl history and others in data dir
We were using the runtime dir with a fallback to a directory
that was equivalent to the data dir on !xdg systems.  That
meant that the state in the runtime dir was often scrubbed
around a reboot.

refs: https://github.com/wez/wezterm/discussions/4019
refs: https://github.com/wez/wezterm/issues/4047
2023-07-22 10:31:03 -07:00
Malthe Larsen 94ab049637 add plugin_dir field to RepoSpec (#4017) 2023-07-17 11:16:33 -07:00
Wez Furlong b7771feef6 imgcat: work better with tmux and conpty
Neither of these understand image protocols, and both are
an additional processing layer between the application and
wezterm.

This commit detects and wraps OSC sequences in tmux's passthru
sequence so that the data is passed on to wezterm rather than
elided from the data stream.

For image protocols in both tmux and conpty, work a little
smarter and explicitly move the cursor position to the same
location that wezterm would move it to.  That prevents the
display from being as mangled by tmux/conpty due to a diverging
understanding of the cursor position.

The logic isn't perfect, and can result in the x-coordinate
being incorrect, and this won't work with the new --position
argument either in its current state, without adding a lot
of complexity to deal with scrolling and relative and absolute
positioning handling.

To facilitate that, a new termwiz Terminal trait method has
been added to probe the terminal name, version, cell and pixel
dimensions. It's not pretty.

refs: https://github.com/wez/wezterm/issues/3624
refs: https://github.com/wez/wezterm/issues/3716
2023-07-15 22:13:19 -07:00
Wez Furlong 115e629ec1 fix pane:split{}
Similar issue as 31eb4fe271

refs: https://github.com/wez/wezterm/issues/3985
2023-07-13 17:44:00 -07:00
Wez Furlong 750f49f0ae deps: upgrade mlua to 0.9.0-rc.1
refs: https://github.com/khvzak/mlua/issues/291
refs: #3849
2023-07-12 14:14:55 -07:00
Carsten Kragelund 780ae67c71 fix(plugin): drop Repository, so that renaming succeeds on Windows 2023-05-28 09:18:42 -07:00
Wez Furlong ff153a9237 pick up updated spa crate
This one has my chrono/time updates included

refs: https://github.com/frehberg/spa-rs/pull/5
2023-04-20 21:56:10 -07:00
Wez Furlong 0a47f8ea76 remove transitive dep on time 0.1
chrono still is pulling this in for some reason. Super frustrating.

refs: https://github.com/chronotope/chrono/issues/602
2023-04-18 13:53:59 -07:00
Wez Furlong 0ca050e09d expose the tty name associated with a pane 2023-04-06 17:13:07 -07:00
Wez Furlong fd634c2450 fix unused import warning 2023-04-03 20:26:33 -07:00
Wez Furlong 45db43aa95 fix permute_any_mods
The termwiz Modifiers type isn't the right one!
Use the input layer types instead, and then we get the correct
string formatting.

refs: https://github.com/wez/wezterm/issues/3434
2023-04-03 08:43:03 -07:00
Jalil David Salamé Messina b32863cc2f fix(clippy): Implement From instead of Into
Implementing `From` is prefered as this also implements the `Into` trait, may
not be desireable for code size/compilation time reasons.
2023-04-03 08:31:12 -07:00
Wez Furlong 50172f2e88 add wezterm.mux.rename_workspace
refs: #2787
2023-04-02 08:03:07 -07:00
Wez Furlong ea28fb891a add window:active_tab(), window:active_pane(), tab:active_pane() 2023-04-01 19:46:15 -07:00
Wez Furlong a5b52de02c populate ssh domains from your ssh config by default
If you haven't assigned `config.ssh_domains` to something else,
this commit will populate it from the hosts it finds in your
ssh config file.

First it will emit no-multiplexing entries that allow ad-hoc
ssh connections.

Then it will emit wezterm multiplexing enabled versions of those
entries.
2023-03-29 11:51:59 -07:00
Wez Furlong dd16e586c3 add pane:activate() and tab:activate()
refs: #3217
2023-03-27 21:12:10 -07:00
Wez Furlong e56b169cc4 mux: add lua api equivalent to move-pane-to-new-tab
refs: #3374
2023-03-26 11:08:43 -07:00
Wez Furlong 2e488d57c7 update terminfo to 0.8 2023-03-24 10:12:49 -07:00
Wez Furlong 4913817067 allow json encoding wezterm.GLOBAL entries 2023-03-22 09:30:02 -07:00
Wez Furlong 8755e731d3 add __len and __pairs metamethods to wezterm.GLOBALS
Fixes this:

```
> wezterm.GLOBAL.foo = {"bar", "baz"}
> wezterm.GLOBAL.foo
[
    "bar",
    "baz",
]
> #wezterm.GLOBAL.foo
runtime error: [string "repl"]:1: attempt to get length of a userdata value (field 'foo')
stack traceback:
        [string "repl"]:1: in main chunk
>
```

and allows this:

```
> for k, v in pairs(wezterm.GLOBAL.foo) do print(k, v) ; end
```
2023-03-21 21:04:52 -07:00