Commit Graph
7698 Commits
Author SHA1 Message Date
Wez Furlong b2ae5ade79 docs: show how to get whole scrollback in get_xxx_as_text
Folks often ask how to do this. Pre-empt the question.
2024-01-27 11:05:43 -07:00
Wez Furlong 2a8bdfa603 launcher: allow ctrl-[ to close launcher menu
refs: https://github.com/wez/wezterm/issues/4722
2024-01-27 09:01:33 -07:00
Jeffrey Knockel 178f35a496 wayland: consider base in resize increment calc
This corrects the calculation so that the # of terminal cells will not
change on a scale change.
2024-01-26 12:26:53 -07:00
Wez Furlong d82283364a x11/wayland: fixup altgr in eg: azerty layout
It's important not to clobber the layout number, and we need to
pass through more of the modifier bits from the X event, so we
just pass them all through wholesale.

refs: https://github.com/wez/wezterm/issues/4864
2024-01-26 06:51:50 -07:00
ErrorNoInternet d5c4f8782c chore(nix): update hashes for git
It is no longer fetched from git.
2024-01-26 06:00:57 -07:00
ErrorNoInternet c13bd406ea ci: actually build wezterm 2024-01-26 06:00:57 -07:00
hyperpuncher 0839745aaf fix: disproportionate cursor 2024-01-26 05:29:32 -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 29d8bcc6ea docs: remove selection restriction
This used to make things such that the copy button for `console`
blocks would only copy the input and not the output, but it
doesn't seem to have that effect any more, and now just prevents
selecting portions of the output.

That's a PITA because eg: the CLI --help pages use `console`
to show which options are available.

I think something has probably changed somewhere in upstream mkdocs
because this used to work as I mentioned above.

refs: https://github.com/squidfunk/mkdocs-material/issues/6697
2024-01-25 13:09:36 -07:00
Wez Furlong 1f9f3f2a5d docs: changelog for https://github.com/wez/wezterm/pull/4850
and rustfmt on my little tweak
2024-01-25 08:23:17 -07:00
RyanandWez Furlong 27259cb857 fix: render bar cursors on topmost layer (#4850)
* fix: render bar cursors on topmost layer

* avoid cost of building error string unless layer allocation fails

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2024-01-25 08:22:04 -07:00
Wez Furlong 750b7ae849 x11: refactor selection logic in the spirit of DRY
This also will fulfil the promise in an error case which may help
things to be a bit more robust.

refs: https://github.com/wez/wezterm/issues/4402
2024-01-25 07:31:23 -07:00
Wez Furlong 2afa36d9b1 x11: more actively try to fallback to STRING for selection
If we get NONE back in response to our request for a utf8 selection,
repeat the request but for STRING.

refs: https://github.com/wez/wezterm/issues/4402
2024-01-25 07:21:51 -07:00
Wez Furlong 6db993c6cd docs: fix typo 2024-01-25 07:04:31 -07:00
Wez Furlong 30d6c6d9c0 docs: fix typo 2024-01-24 22:11:22 -07:00
Wez Furlong ad762e5aa2 docs for https://github.com/wez/wezterm/pull/4824 2024-01-24 22:07:14 -07:00
Jeffrey Knockel 642bfbb69a macos: set minimum increment size to 1x1 cells 2024-01-24 22:04:16 -07:00
Jeffrey Knockel 4546133d35 wayland: set minimum increment size to 1x1 cells 2024-01-24 22:04:16 -07:00
Jeffrey Knockel b0193850be x11: set minimum increment size to 1x1 cells
Depending on the amount of padding, we could previously resize to get a
negative size displayed by the window manager's overlay (e.g., 80x-1 for
a very short window displaying zero terminal lines and only partially
showing the top of the tabs).  We would also like to avoid 80x0 or 0x24
dimensions as these can render funny.  For example, when there is a lot
of padding, an 80x0 size can still show part of the top of the first
line despite it being a cell height of zero.
2024-01-24 22:04:16 -07:00
Jeffrey Knockel 0462f318d7 Set base_width/height in set_resize_increments
On X11, this information is set as part of the hints given to the window
manager. When resizing the terminal, many X11 window managers will now
correctly report the current cell size of the terminal (e.g., 80x24) as
an overlay when resizing the window.
2024-01-24 22:04:16 -07:00
Jeffrey Knockel c70e2fea28 Move set_resize_increments() to apply_dimensions() 2024-01-24 22:04:16 -07:00
Jeffrey Knockel f204f0f1a9 Refactor set_resize_increment() args into struct 2024-01-24 22:04:16 -07:00
Wez Furlong 46732d049a x11: speculatively allow pasting latin-1 data
refs: https://github.com/wez/wezterm/issues/4402
2024-01-24 16:31:56 -07:00
Andrii 925568a215 Update AttachDomain.md
Fix typo.
2024-01-24 15:23:39 -07:00
Daniel Kongsgaard 1ca3d48cfa Update shell-integration.md 2024-01-24 13:01:38 -07:00
Chris Olszewski 1670b648b7 chore: add signal getter on exit status 2024-01-24 12:51:39 -07:00
fortuneteller2k 328b1f3b15 macos/clipboard: use try_quote instead of quote 2024-01-24 11:57:03 -07:00
Wez Furlong 223ba32de2 x11: fix handling of high-speed key events
test scenario is:

```
bash -c "sleep 5; for((i=0;i<30;i++)); do xdotool keydown --delay 0 Shift_L keydown --delay 0 9 keyup --delay 0 Shift_L keyup --delay 0 9; done"
```

That should cause a series of `(` characters to be emitted, but prior to
this commit is was usually mostly `9`'s.

What's changing here is:
* We copy the pertinent fields from the last xcb StateNotify event.
  That ostensibly has the current modifier and layout state, but
  because it comes from the X server, it doesn't factor in knowledge
  from the IME.
* When processing an XCB key event, compute the current modifier
  mask and override the XKB state with it.
* Now XKB will produce correct information about the key syms
* Restore the modifier state from the saved StateNotify information.

refs: https://github.com/wez/wezterm/pull/4151
refs: https://github.com/wez/wezterm/issues/4615
refs: https://github.com/fcitx/fcitx5/issues/893
refs: https://github.com/ibus/ibus/issues/2600
refs: https://github.com/wez/wezterm/issues/3840
2024-01-24 08:04:39 -07:00
Wez Furlong 079e87d62e fixup issue with compose key
this partially reverts eb3a78b0cb and
should hopefully resolve the underlying problem, which is that
the composition cursor is stuck at an empty string when using
a compose key on its own.

refs: https://github.com/wez/wezterm/issues/4841
2024-01-24 06:58:07 -07:00
Wez Furlong b3c996016e docs: changelog for #4828
closes: https://github.com/wez/wezterm/issues/4828
2024-01-24 06:53:35 -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 9bae5b4158 switch wholesale to my fork xcb-imdkit, as it is not actively maintained
My branch includes my own fixes, as well as this PR:

refs: https://github.com/H-M-H/xcb-imdkit-rs/pull/3

which should enable this PR that's been blocked on it for a while:
refs: https://github.com/wez/wezterm/pull/2056
2024-01-23 17:50:04 -07:00
Wez Furlong f6aba4b0d6 deps: update zbus 2024-01-23 17:14:47 -07:00
Wez Furlong 201fc1bf8e deps: update xcb 2024-01-23 17:12:16 -07:00
Wez Furlong 33647b029c deps: update x11 2024-01-23 17:04:26 -07:00
Wez Furlong a263fd38f1 deps: update xkbcommon 2024-01-23 17:02:32 -07:00
Wez Furlong eb3a78b0cb x11: synthesize clearing dead key state when forgotten by system
It's not clear exactly how this triggers, but in setups where
a compose key has been configured (against the default for the
configured keyboard layout), it seems as though certain events
that indicate when composition is complete are not delivered,
leaving the compose cursor in an inconsistent state.

This commit attempts to detect that composing->!composing
state transition and bubble it up; when we return Nothing
and had previously had a composition string we're return
a bool to cause the caller to emit an event that clears
the composition state.

I'm not totally sure this is 100% right, but I think
it may help with the case we're discussing in
https://github.com/wez/wezterm/issues/4841
2024-01-23 15:02:50 -07:00
Wez Furlong 045e92be1b x11: always trust key event modifiers over xkd modifiers
in discussion: https://github.com/ibus/ibus/issues/2600#issuecomment-1904322441
the summary is that the StateNotify event which is used to update
the xkd modifier state is sourced directly from the X server and
doesn't account for any state maintained by the IME.

The key press and release events do include the correct state,
so we should always prefer to use the modifiers from those events
on X11.

Under wayland, we continue to use the kbd state.

refs: https://github.com/ibus/ibus/issues/2600
refs: https://github.com/wez/wezterm/pull/4151
2024-01-23 14:26:53 -07:00
Wez Furlong c0b61d1c6d Revert "x11: add experimental x11_use_passive_key_updates config option"
This reverts commit c7c0cabbb7.
2024-01-23 14:09:44 -07:00
Wez Furlong c7c0cabbb7 x11: add experimental x11_use_passive_key_updates config option
In discussion about the ongoing weirdness with modifier processing,
it sounds like we could/should be using `update_key` rather than
`update_mask` under X11.  (Wayland: has to use `update_mask`,
per the docs:
https://docs.rs/xkbcommon/latest/xkbcommon/xkb/struct.State.html#method.update_key)

I quickly tried out a proof of concept with this and it
doesn't seem to hurt, but since I'm unsure if there are other
nuances to consider, I've put this behind a config option.

`x11_use_passive_key_updates` defaults to true which results
in the use of `update_mask` on X11.

Setting it to false will switch to using `update_key` instead,
and may improve handling of xkb states.

refs: https://github.com/wez/wezterm/issues/4841
refs: https://github.com/ibus/ibus/issues/2600
refs: https://github.com/wez/wezterm/pull/4151
2024-01-23 12:19:40 -07:00
Wez Furlong 02bdd7ed56 rustfmt 2024-01-23 10:29:46 -07:00
Wez Furlong 851997cce4 x11: synthesize clearing dead key status when composing via IME
We have two different ways to compose:

* Via xkbd
* Via IME messages

In the latter case, we receive notifications from the IME about
the composed text, but are apparently not guaranteed to receive
them about the composition status overall.

This commit will synthesize clearing the composition status
when we receive the instruction to emit composed text.

The hope is that this will clear the compose cursor state
that appears to get stuck for some users of ibus + Gnome 45.

refs: https://github.com/wez/wezterm/issues/4841
2024-01-23 10:25:52 -07:00
Wez Furlong 463c457528 thread pane through to other scroll actions as well
This should allow mouse bindings that control scrolling
to also work with the hovered pane.

refs: https://github.com/wez/wezterm/issues/4835
2024-01-23 09:30:22 -07:00
Mikko Perttunen 12a6b8df84 termwiz: surface: Fix cursor movement in DiffState
DiffState keeps track of a virtual cursor in order to skip emitting
cursor location changes when a previous text change has already moved
the cursor to the desired position. However, currently the code always
advances the cursor by 1 column for each added text change regardless
of the width of the text.

Fix behavior by advancing the cursor by the width of the text.
To avoid having to add a new variable, make 'self.cursor' contain
the cursor position for the next cell instead of the current cell.

In addition, add a test verifying the behavior.
2024-01-23 06:42:13 -07:00
Mikko Perttunen ec0cb7ce1b termwiz: surface: Fix cell diffing in presence of wide cells
The present code for creating diffs between surface regions processes
visible cells from both surfaces in lockstep. This only works when
the cells at each position have the same width in each surface.
When widths differ, the iterators go out of sync and end up comparing
cells in different positions of the surface, resulting in incorrect
diffs.

Fix this by instead iterating over the source surface ('other'), and
for each cell locating the corresponding cell in the target surface
to compare against.

To apply the fix to all three diffing functions, outline the per-line
code to a new function and call it in each function.

Also add a test that verifies the behavior in such case with differing
cell widths.
2024-01-23 06:42:13 -07:00
Ye Sijun e3ccf2eacc Remove reserved space in full screen
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2024-01-23 06:33:16 -07:00
Wez Furlong 73c8bbb8e0 docs: changelog and update for #4426 2024-01-23 06:30:32 -07:00
Xiaopeng Li a84e5fedb1 impl FT_PIXEL_MODE_LCD_V 2024-01-23 06:26:28 -07:00
Wez Furlong 0dedc7684d shell-integration: update bash-preexec.sh
It seems like newer versions collide with older versions(!)

https://fosstodon.org/@jimw@mefi.social/111797116746117103

so let's update to the newest version.
2024-01-23 06:19:39 -07:00