1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-11 14:25:57 +03:00
Commit Graph

23 Commits

Author SHA1 Message Date
Wez Furlong
bc7acc18e0
fixup images with the multiplexer
* Translate from File to EncodedFile as needed
* Adopt blob leases in the mux server
* Fix an issue where the first image sent by the mux server would
  be replaced on the client by its background image, if configured.
  Removed the ImageData::id field to resolve this: you should use
  the hash field instead to identify and disambiguate images.
  Bumped the termwiz API version because this is conceptually
  a breaking change to the API

refs: https://github.com/wez/wezterm/issues/3343
2023-03-23 21:43:28 -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
Wez Furlong
e090eb9eae
Image decoding is now done in a bg thread
Continuing from the previous commit, this shifts:

* In-memory data -> temporary file
* Image decoding -> background thread

The background thread asynchronously decodes frames and
sends them to the render thread via a bounded channel.

While decoding frames, it writes them, uncompressed, to
a scratch file so that when the animation loops, it is
a very cheap operation to rewind and pull that data
from the file, without having to burn CPU to re-decode
the data from the start.

Memory usage is bounded to 4 uncompressed frames while
decoding, then 3 uncompressed frames (triple buffered)
while looping over the rest.

However, disk usage is N uncompressed frames.

refs: https://github.com/wez/wezterm/issues/3263
2023-03-17 11:41:20 -07:00
Wez Furlong
3509e210ce
termwiz: bump version ready for publish 2023-02-12 06:57:31 -07:00
Wez Furlong
a6fc9323e2 termwiz: release 0.19 2022-11-02 08:16:09 -07:00
Wez Furlong
c91d6c396c termwiz: prepare for a 0.18.0 release 2022-09-21 19:20:26 -07:00
Davide Cavalca
0048209bcf Add missing license files 2022-08-17 07:19:12 -07:00
Wez Furlong
edeae72b5f termwiz: bump version to 0.17 2022-08-01 18:31:43 -07:00
Wez Furlong
d0d23d6c46 termwiz: prep for crates.io 2022-04-07 07:27:54 -07:00
Wez Furlong
b40f65c25e termwiz: s/Fuschia/Fuchsia/g
closes: #1407
2021-12-21 20:38:59 -07:00
Wez Furlong
225e7a1243 introduce unicode_version config
This is a fairly far-reaching commit. The idea is:

* Introduce a unicode_version config that specifies the default level
  of unicode conformance for each newly created Terminal (each Pane)
* The unicode_version is passed down to the `grapheme_column_width`
  function which interprets the width based on the version
* `Cell` records the width so that later calculations don't need to
  know the unicode version

In a subsequent diff, I will introduce an escape sequence that allows
setting/pushing/popping the unicode version so that it can be overridden
via eg: a shell alias prior to launching an application that uses a
different version of unicode from the default.

This approach allows output from multiple applications with differing
understanding of unicode to coexist on the same screen a little more
sanely.

Note that the default `unicode_version` is set to 9, which means that
emoji presentation selectors are now by-default ignored.  This was
selected to better match the level of support in widely deployed
applications.

I expect to raise that default version in the future.

Also worth noting: there are a number of callers of
`unicode_column_width` in things like overlays and lua helper functions
that pass `None` for the unicode version: these will assume the latest
known-to-wezterm/termwiz version of unicode to be desired. If those
overlays do things with emoji presentation selectors, then there may be
some alignment artifacts. That can be tackled in a follow up commit.

refs: #1231
refs: #997
2021-11-25 09:00:45 -07:00
Wez Furlong
b0f5e673c6 vtparse/termwiz: prep for release 2021-04-14 13:04:23 -07:00
Wez Furlong
f4105cb42f avoid excess capacity when dealing with iterm2 image protocol
Using a boxed slice means that we hold exactly the memory required
for the file data, rather than the next-power-of-two, which can
be wasteful when a large number of images are being sent to
the terminal.

This is a API breaking change for termwiz, so bump its version.

refs: #534
2021-03-13 08:10:48 -08:00
Wez Furlong
2a87c1dec7 Change cell api to avoid direct access to hyperlink/image
This allows potentially changing the struct layout
to reduce the struct size.
2020-10-11 13:12:46 -07:00
Wez Furlong
65f94bd57b vtparse: fix DCS parsing
This corrects an issue where the mode byte of the DCS sequence was
discarded from the DcsHook, making it impossible to know what sequence
is being activated.

So far this hasn't come up as these sequences are relatively rare,
but in looking at sixel parsing I noticed the error.
2020-06-09 09:03:08 -07:00
Wez Furlong
1ad6f00696 termwiz: cut 0.9.0 release 2020-05-17 12:05:46 -07:00
Wez Furlong
92035e7704 tabout: bump version for termwiz bump 2020-04-15 08:24:11 -07:00
Wez Furlong
aaf3a7fcaf termwiz: allow using terminfo on Windows
This commit changes the behavior on Windows:

* If $TERM is set and the `terminfo` crate is able to
  successfully initialize and locate a terminfo database (this also
  requires that $TERMINFO be set in the environment), then we'll
  use the `TerminfoRenderer` instead of the `WindowsConsoleRenderer`
* If $TERM is set to `xterm-256color` and no terminfo database was
  found, use our modern compiled-in copy (look in the `termwiz/data/`
  directory for the source and compiled version of this) and use
  the `TerminfoRenderer`.
* Otherwise use the `WindowsConsoleRenderer`.

In practice, this allows termwiz apps to opt in to features such as
true color support on Windows 10 build 1903 an later by setting their
`TERM=xterm-256color`.   This happens to be the default behavior when
`ssh`ing in to a windows host via `wezterm`.

You can see the truecolor mode get applied by running this example:

```
cargo run --example widgets_basic --features widgets
```

with TERM set as above the background region that is painted by the app
will be a blueish/purplish color, but with it unset or set to something
invalid, it will fall back to black.

I'd like to eventually make termwiz assume the equivalent configuration
to `TERM=xterm-256color` by default on Windows 10 build 1903 and later,
but it's worth getting some feedback on how this works for clients such
as `streampager`.

cc: @quark-zju and @markbt
2020-04-04 17:52:53 -07:00
Wez Furlong
466961f9c3 tabout: allow tabulating Change slices for colorized output 2020-04-04 13:40:45 -07:00
Wez Furlong
6c9052b1a5 tabout: prep for publish 2020-04-04 11:32:37 -07:00
Wez Furlong
cb9e0f9c59 tabout: correctly handle unicode width
This commit fixes this:

```
STAT                  p50      p75       p95
Key(gui.paint.opengl) 30.15ms  32.37ms   59.51ms
Key(shape.harfbuzz)   68.10µs 290.82µs 307.20µs
```

so that it renders like this:

```
STAT                  p50      p75      p95
Key(gui.paint.opengl) 5.28ms   28.97ms  89.65ms
Key(shape.harfbuzz)   210.94µs 288.77µs 395.26µs
```
2020-01-05 14:37:17 -08:00
Wez Furlong
df20277d85 clippy 2019-07-06 08:18:59 -07:00
Wez Furlong
1d44098747 add cli command to list tabs 2019-06-13 21:53:14 -07:00