1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00
Commit Graph

89 Commits

Author SHA1 Message Date
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
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
74da631430
mux: allow client to provide palette to mux server
The server-side ownership of the palette is a stumbling block for
many users, so let's fix it.

This commit allows the client to pass its configured palette to
the server when it connects, and when the config is changed.

That palette takes precedence over the palette from the server config.

However, if the remote application uses any escape sequences that
redefine the color palette, the color palette that was active at
that point in time is forked and use as the basis, and will remain
the active palette until the palette is reset via escape sequences.

refs: https://github.com/wez/wezterm/issues/2686
refs: https://github.com/wez/wezterm/issues/3397
2023-03-31 08:02:32 -07:00
Wez Furlong
2e488d57c7
update terminfo to 0.8 2023-03-24 10:12:49 -07:00
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
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
97452d0ccc
term: improve readability of error message for oversized image
refs: https://github.com/wez/wezterm/issues/3264
2023-03-16 22:41:52 -07:00
Wez Furlong
2bfb29f1be
improve handling of animated webp images
Use mainline image crate to avoid an otherwise unavoidable panic
in the upstream: https://github.com/image-rs/image/issues/1775

Explicitly operate on the frames from the animation.

refs: https://github.com/wez/wezterm/issues/3250
2023-03-15 11:34:47 -07:00
Wez Furlong
3509e210ce
termwiz: bump version ready for publish 2023-02-12 06:57:31 -07:00
Wez Furlong
9923ae20b5
env_logger -> 0.10
closes: https://github.com/wez/wezterm/pull/2803
2022-11-27 21:37:25 -07:00
Wez Furlong
a6fc9323e2 termwiz: release 0.19 2022-11-02 08:16:09 -07:00
Wez Furlong
b1faba9d8a deps: upgrade finl_unicode to 1.2 2022-10-23 12:07:00 -07:00
Wez Furlong
c91d6c396c termwiz: prepare for a 0.18.0 release 2022-09-21 19:20:26 -07:00
Wez Furlong
85db555b37 deps: update finl_unicode 2022-09-16 07:47:33 -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
c25e6820ef add normalize_to_nfc config option
refs: #2482
2022-09-06 08:58:09 -07:00
Wez Furlong
edeae72b5f termwiz: bump version to 0.17 2022-08-01 18:31:43 -07:00
Wez Furlong
75066cb522 deps: update
Main thing to note here is that the open crate has deprecated
open::that_in_background, but made open::that non-blocking.

I think this is OK, but I'm a little cagey about what will
happen with this on Windows.  We may need to spawn our own
thread for this if things go awry.
2022-06-12 20:17:48 -07:00
Wez Furlong
0e0bac2576 deps: prune some unused deps 2022-05-19 06:48:09 -07:00
Wez Furlong
0b61d41f8f remove serde from bidi 2022-05-18 09:25:41 -07:00
Wez Furlong
f587cac145 config: cut over to wezterm-dynamic
Avoid using serde for mapping between Lua and Rust for the `Config`
struct.

This improves the build speed of the config crate by 2x; it goes down
from 30 seconds to 9 seconds on my 5950x.
2022-05-18 07:47:39 -07:00
Wez Furlong
a6c1680df4 deps: replace pretty_assertions dep with k9 2022-05-04 20:16:41 -07:00
Wez Furlong
e0785311c1 deps: ordered-float
closes: https://github.com/wez/wezterm/pull/1946
2022-05-01 21:43:22 -07:00
Wez Furlong
b35e3b2aad deps: remove pretty_env_loggger
Go directly to the underlying env_logger crate, as pretty_env_logger
hasn't been updated in some time, and I'd like to be able to redirect
the log output to a file more directly, and that feature is in a newer
version of the env logger than pretty_env_logger was pulling in.
2022-04-07 08:24:07 -07:00
Wez Furlong
d0d23d6c46 termwiz: prep for crates.io 2022-04-07 07:27:54 -07:00
Wez Furlong
435ff1e93b deps: image -> 0.24 2022-02-06 18:51:32 -07:00
Wez Furlong
75e785e01e allow using CSS style color specs in the config
This change also allows removing the dep on the palette crate,
which I found to be difficult to use (API changed often, and relied
on a lot of `.into` that was hard to follow and reconcile across
upgrades).  We already pulled in the csscolorparse crate as an indirect
dep of colorgrad, so we can replace the color conversion we need for
sixel with that crate while we're in here.

refs: #1615
2022-02-06 08:23:26 -07:00
Wez Furlong
98f35bbf24 bidi: tag Line with bidi mode
This commit refines bidi property handling:

* experimental_bidi has been split into two new configuration settings;
  `bidi_enabled` (which controls whether the terminal performs implicit
  bidi processing) and `bidi_direction` which specifies the base
  direction and whether auto detection is enabled.
* The `Line` type can now store those bidi properties (they are actually
  split across 3 bits representing enabled, auto-detection and
  direction)
* The terminal now has a concept of active bidi properties and default
  bidi properties
* The default properties are pulled from the wezterm configuration
* active bidi properties are potentially set via escape sequences,
  BDSM (which sets bidi_enabled) and SCP (which sets bidi_direction).
  We don't support the 2501 temporary dec private mode suggested by
  the BIDI recommendation doc at this time.
* When creating new `Line`'s or clearing from the start of a `Line`, the
  effective bidi properties are computed (from the active props,
  falling back to default propr) and applied to the `Line`.
* When rendering the line, we now look at its bidi properties instead
  of just the global config.

The default bidi properties are `bidi_enabled: false` and
`bidi_direction: LeftToRight` which corresponds to the typical
bidi-unaware mode of most terminals.

It is possible to live reload the config to change the effective
defaults, but note that they apply, by design, to new lines being
processed through the terminal.  That means existing output is
left unaffected by a config reload, but subsequently printed lines
will respect it.  Pressing CTRL-L or otherwise contriving to have
the running application refresh its display should cause the
refreshed display to update and apply the new bidi mode.

refs: #784
2022-01-30 09:50:04 -07:00
Wez Furlong
7ccce20544 fonts: allow harfbuzz to guess the script
Our default meant that harfbuzz wouldn't engage preprocessing
steps that normalized the text to NFC.  With this change we now
correctly normalize and render certain compositions that were
totally borked previously.

refs: https://github.com/wez/wezterm/issues/1573
refs: https://github.com/wez/wezterm/issues/1474
2022-01-21 10:10:39 -07:00
Wez Furlong
79f7f63064 deps: ordered-float -> 2.10
closes: https://github.com/wez/wezterm/pull/1524
2022-01-09 19:25:48 -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
d461c1c0b6 deps: lru 0.6 -> 0.7 2021-10-10 19:29:42 -07:00
Wez Furlong
545a8fc8a7 deps: ordered-float -> 2.8 2021-09-05 23:25:37 -07:00
Wez Furlong
ab21910d80 deps: update bitflags -> 1.3 2021-08-15 18:21:17 -07:00
Wez Furlong
6f78ee4f14 deps: update unicode-segmentation to 1.8 2021-08-11 23:06:17 -07:00
Wez Furlong
e85e94248b basic kitty img animation support
this is the bare minimum to squeak by with notcurses; it currently
only supports editing single frame images.

refs: #986
2021-08-02 21:35:57 -07:00
Wez Furlong
90b16b9518 move image decoding into termwiz
Adds a use_image feature to termwiz that enables an optional
dep on the image crate.  This in turn allows decoding of animation
formats (gif, apng) from file data, but more crucially, allows
modeling animation frames at the termwiz layer, which is a pre-req
for enabling kitty img protocol animation support.

refs: #986
2021-08-02 21:35:50 -07:00
Wez Furlong
b862c8d111 termwiz: add ImageData::hash
Moves the localized hashing logic from term -> termwiz
where it can be re-used.

refs: #986
2021-08-02 09:18:25 -07:00
Wez Furlong
96f15a065c kitty img: add deflate support
Untested... it compiles!

refs: #986
2021-07-28 09:29:40 -07:00
Autumn Lamonte
d2e2c5dec6 #133 clean up DECREQTPARM 2021-07-24 23:19:51 -07:00
Autumn Lamonte
31aff81884 #133 DECREQTPARM - needs cleanup 2021-07-24 23:10:52 -07:00
Wez Furlong
6ddc8afc64 termwiz: recognize the XTGETTCAP DCS sequence
Parse and respond to this sequence docs can be found
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Device-Control-functions:DCS-plus-q-Pt-ST.F95

refs: https://github.com/wez/wezterm/issues/954
2021-07-24 21:06:48 -07:00
Wez Furlong
a2e882a7cb deps: cargo update, and a couple of dependabot suggestions 2021-07-18 19:10:46 -07:00
Wez Furlong
b03e27adb1 deps: ordered-float 2.1 -> 2.5
closes: https://github.com/wez/wezterm/pull/831
2021-05-31 00:17:18 -07:00
Wez Furlong
b0f5e673c6 vtparse/termwiz: prep for release 2021-04-14 13:04:23 -07:00
Aaron Abramov
786888ce0a update k9 to 0.11.0 to make it work with rustc@1.51.0
1.51.0 no longer takes non string literals in `panic()`. k9@0.11.0 fixes that
2021-03-25 10:39:00 -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
005b492a8b deps: update to ordered-float 2.1 2021-02-07 22:54:02 -08:00
Wez Furlong
7cbbb49ab4 deps: ordered-float -> 2.0 2020-12-28 08:25:43 -08:00