Commit Graph
653 Commits
Author SHA1 Message Date
Wez Furlong 54e70e51d2 wezterm-term: revise approach to zero-width graphemes
refs: https://github.com/wezterm/wezterm/issues/1422
refs: https://github.com/wezterm/wezterm/issues/6637

When we encounter a zero-width grapheme we need to be
a little bit smarter about how we handle it.

In the original implementation we'd unconditionally
remap these graphemes into a cell, effectively making
them appear as a blank cell with width of one.

Later we discovered that eg: BIDI control characters
should not be forced to display in this way, so the
logic was changed to elide these graphemes from the
model.

Subsequently we've found that the unicode line separator
should be treated as a blank.  The unicode FAQ says
that any character that has the White_Space property
should be treated that way.

This commit applies that logic: if we get a zero-width
grapheme, if it is white space we'll force it to
have a width of 1, otherwise we'll elide it from
the model.

This probably is still not perfect, but hopefully
balances things out to be good enough, at least
until we find an example of where it isn't the right call!
2025-03-09 06:28:06 -07:00
Wez Furlong 15506bf3ef term: moved saved cursor from ScreenOrAlt -> Screen
refs: #6669
2025-03-06 15:23:38 -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 4d3911b5e2 termwiz: prep for making a new release 2025-02-10 08:45:17 -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 fb023956cf termwiz: parse ConEmu progress OSC sequence
refs: https://github.com/wezterm/wezterm/issues/6581
2025-02-09 17:19:50 -07:00
Jose Biosca 47b91d8e0e fix mouse button streak requiring pixel precision 2025-02-07 19:11:37 -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 00644d4e1a update for new wezterm.org domain 2025-02-06 21:13:50 -07:00
Sean Estabrooks 659aedffe8 Region scrolling tests and a fix
@tbung fixed a scrolling bug in #6099.  This patch just
adds some tests and takes care of a couple corner cases
that still remained with region scrolling.
2024-11-28 09:01:13 -07:00
Sean Estabrooks b2889fe889 Region scrolling tests 2024-11-28 09:01:13 -07:00
Wez Furlong c0649ad4bb remove cfg_attr(feature = "cargo-clippy" noise
I never liked clippy for dropping turds like this throughout the
code. I'm glad it is no longer required, but now rust is warning
about this syntax being redundant.
2024-09-14 06:49:13 -07:00
Wez Furlong 45ec2464e5 docs and related fix for #6099
We should avoid nudging the scrollback position when there is no
scrollback allowed in this other case as well.

refs: https://github.com/wez/wezterm/pull/6099
2024-09-14 06:42:10 -07:00
Till Bungert f911e48a95 fix: only change stable row offset if screen has scrollback 2024-09-14 06:37:36 -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
Thayne McCombs 03407cae99 fix: Use cols not rows for left margin bound
The location of the left margin should depend on the width, not the
height.

Fixes: #5750
2024-07-30 07:40:42 -07:00
Wez Furlong 2a068cacb7 deps: update terminfo 2024-05-13 12:29:19 -07:00
Wez Furlong 0f03117776 deps: update miniz-oxide 2024-05-13 11:55:58 -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 91a16e5224 remove unused local
this should have happened in efbafbc229
2024-05-09 22:30:25 -07:00
Wanchang Ryu efbafbc229 fix wrapped long line copy problem on tmux
wezterm ignores wrapped long line when alt screen is used and tmux uses
alt screen that makes copying wrapped long line into multiple lines.

After testing on sevaral tui apps like tmux, w3m, htop it seems to show
reasonable performance on resizing.

Fixes #5283
2024-05-09 14:35:26 -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
Pi-Cla ee61e61e4f [PATCH] Fix various cargo audit errors
closes: https://github.com/wez/wezterm/pull/5206
2024-05-04 22:47:57 -07:00
Wez Furlong aa94a98314 fix invalidation on palette change
refs: https://github.com/wez/wezterm/issues/4932
and possibly: https://github.com/wez/wezterm/issues/2635
2024-02-01 15:58:14 -07:00
Wez Furlong 86d9ec69f5 term: downgrade conpty tmux title mangling warning to debug
The user can't do anything about it anyway.
2024-01-31 07:36:30 -07:00
jonboh 820c451b57 add small helper function to better express bool casting 2024-01-28 07:59:13 -07:00
jonboh 500f84617e fix kitty image protocol display parameters 2024-01-28 07:59:13 -07:00
Wez Furlong 7f3a835548 fix excessive calls to format-tab-title
* Removed title update from main render loop
* Add to PaneFocused event
* term: only emit Alert::OutputSinceFocusLost for the first
  seqno bump after losing focus, rather than on every bump.
  That event indirectly causes the title to update

refs: https://github.com/wez/wezterm/issues/4788
2024-01-25 23:14:38 -07:00
Wez Furlong 516add5a4b fixup tests for seqno increment on resize change
refs: https://github.com/wez/wezterm/issues/4828
refs: https://github.com/wez/wezterm/issues/3694
refs: https://github.com/wez/wezterm/issues/2351
2024-01-23 18:31:59 -07:00
Wez Furlong 8f74e1c848 increment seqno when resizing
Without this, we don't invalidate the shape hash eg: when zooming a
pane.  This is potentially also the root cause of some other weirdness
with the multiplexer.

refs: https://github.com/wez/wezterm/issues/4828
refs: https://github.com/wez/wezterm/issues/3694
refs: https://github.com/wez/wezterm/issues/2351
2024-01-23 18:08:46 -07:00
Wez Furlong ba85958a61 deps: update env-logger
Note that we are pinned on 0.10 for env-bootstrap, where we use it
only for its module filter parser.
2024-01-20 16:01:10 -07:00
Wez Furlong 9fc89e621f de-fang paste payloads by removing bracketed paste sequences from them
refs: https://github.com/wez/wezterm/issues/4765
2024-01-08 18:17:22 -07:00
Luis Javier Merino Morán 97e001c93c Clamp cursor position reported by CPR
From esctest:
CHATests.test_CHA_OutOfBoundsLarge
CUPTests.test_CUP_OutOfBoundsParams
HVPTests.test_HVP_OutOfBoundsParams
2023-11-22 14:56:26 -07:00
Luis Javier Merino Morán 769840d2cb DECRQCRA: treat uninitialized cells as spaces
The concept of uninitialized cells in wezterm is not the same as that on
VT520 or that on xterm, so treat them as spaces, at least when asking
for the checksum of a single cell, which is what esctest does.
2023-11-22 14:38:11 -07:00
Luis Javier Merino Morán c4654d8bf4 Make RIS also clear the alternate screen
xterm clears the alternate screen on RIS since #383. VTE and konsole
already did that.

From esctest:
RISTests.test_RIS_ExitAltScreen
2023-11-12 17:09:34 -07:00
Luis Javier Merino Morán f880188ae4 Default G1 to ASCII
As per DEC STD-070 3.6.4

refs: https://github.com/wez/wezterm/issues/3962
2023-11-07 08:22:51 -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
Sean Sullivan 5161de59fe expose pen attribute on terminal info 2023-09-22 12:21:15 -07:00
Wez Furlong 33e727b074 Respond to DECRQM 2027 - grapheme clustering
closes: https://github.com/wez/wezterm/issues/4320
2023-09-20 14:48:05 -07:00
Wez Furlong c1b7ba2f35 fix warning in latest rust compiler 2023-08-28 06:39:14 -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
Rémi Labeyrie da2c035ad2 feat: handle horizontal mousewheel events 2023-07-10 12:55:13 -07:00
Wez Furlong c54548df7e Fix ClearToEndOfLine in last column when wrap_next=true
Given a sequence like this, where the `ESC [ K` sequence is
emitted at the last column when wrap_next=true:

\u001b[47;30m  17:24:50 \u001b[0m\u001b[K

rather than treating the column as out of bounds, we'd clear the
final cell.

refs: #3548
2023-05-29 16:01:11 -07:00
Wez Furlong e0a4ebd586 implicitly reset palette when setting it to the equivalent of the config
refs: #3685
2023-05-29 14:46:43 -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 c1366b217d term: respect log_unknown_escape_sequences for OSC 2023-03-29 05:28:28 -07:00
Jalil David Salamé Messina 407b1297eb fix: Update snapshot (see commit 31100244) 2023-03-27 07:38:55 -07:00
Wez Furlong 59503034c7 tidy up some debug logging 2023-03-25 20:33:23 -07:00
Wez Furlong 727cd95dcd images: improve logging when things are weird
refs: https://github.com/wez/wezterm/issues/3366
2023-03-25 18:55:26 -07:00