1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 04:56:12 +03:00
Commit Graph

388 Commits

Author SHA1 Message Date
Sean Estabrooks
c63195f880 Handle # and ? characters in directory path
When referencing the current-working-directory, before
it is set by an OSC 7 escape sequence, we ask the OS
for the correct path.  This path was then being parsed
as a URL; where a "#" or "?" character would be
interpreted as the start of a fragment or query
component of a URL -- which is a mistake.

So this change parses the returned directory as such,
where those characters will be treated as a normal
character in the path.

Nothing is changed for the OSC 7 escape sequence case.
In that case, the application must percent-encode the
path before sending, so that those characters are not
misinterpreted.

As per issue #6158 reported by Syntaxheld
2024-09-21 13:50:42 -07:00
Greg Kuruc
bc2f3668a6 fix: add short circuit to set active pane 2024-09-14 11:43:32 -07:00
Wez Furlong
4884f31762
fix potential panic on shutdown when mux_enable_ssh_agent=true
refs: https://github.com/wez/wezterm/issues/5518
2024-07-13 15:50:03 -07:00
Ivan Moiseev
72465af6d7
Add arrows support for search field (#5416)
* feat: add arrows support for search field
* refactor: extract LineEditBuffer from LineEditor
* refactor: migrate search field to LineEditBuffer
* feat: add key bindings for search field

Co-authored-by: Ken Chou <kenchou77@gmail.com>
2024-06-14 11:21:07 -07:00
Wez Furlong
9bfcb69139
deps: metrics -> 0.23
refs: https://github.com/wez/wezterm/pull/5512
2024-06-07 17:53:46 -07:00
Ivan Moiseev
4f190b0ff6
Fix: slow close non last tab (#5441)
* fix: slow close non last tab

* fix: found better place

* Update mux/src/window.rs

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2024-06-07 17:53:31 -07:00
Wez Furlong
2a068cacb7
deps: update terminfo 2024-05-13 12:29:19 -07:00
Wez Furlong
84bb2fdc46
deps: dedup some nix versions 2024-05-13 11:53:27 -07:00
Wez Furlong
70c4e03750
deps: update flume 2024-05-13 10:29:12 -07:00
Wez Furlong
1ca5e6cc90
deps: upgrade smol to 2.0 2024-05-13 10:26:29 -07:00
Wez Furlong
6c890c3995
update metrics to latest version (0.22) 2024-05-13 09:41:12 -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
0711455135
add default_ssh_auth_sock option
This is useful (essential!) for fixing up the default auth sock
under gnome, as we do not have a way to do that via whatever
logic may be present in the shell startup files.
2024-05-09 14:27:03 -07:00
Wez Furlong
4af418fddd
mux: enable ssh agent forwarding
This is done with a wezterm twist: not only is the auth sock forwarded,
but the mux on the remote end will automatically maintain a symlink to
point to the auth sock of the most recently active mux client, and set
SSH_AUTH_SOCK to that symlink so that your remote panes should always be
referencing something sane.

refs: https://github.com/wez/wezterm/issues/1647
refs: https://github.com/wez/wezterm/discussions/988
2024-05-09 12:52:29 -07:00
Wez Furlong
6b93ee19e7
mux: record client ssh_auth_sock information
This commit expands the set of data that we track for each client to
include the SSH_AUTH_SOCK. This defaults to the value of that env var on
the machine where the ClientId is constructed, which may be remote from
the mux server.

For the proxy scenario, a remote SSH_AUTH_SOCK path is not addressable,
and what we really want is the local SSH_AUTH_SOCK path from that SSH
session, so we introduce awareness of whether the current session is a
proxy session. Proxy sessions register the mux-local-proxy-id during the
setup of the proxy, but we don't apply the identity to the mux. Instead,
we wait for the remote client to send their identity and that is
annotate to show that it has been routed via a proxy and, crucially, has
the SSH_AUTH_SOCK replaced with the mux-local-proxy-id SSH_AUTH_SOCK.

```
; wezterm cli list-clients
USER HOST                          PID CONNECTED     IDLE         WORKSPACE FOCUS SSH_AUTH_SOCK
wez  foo                        336500 86.944834352s 944.834352ms default       3 /home/wez/.1password/agent.sock
wez  foo (via proxy pid 337457) 337314 1.944834352s  944.834352ms               4 /tmp/ssh-XXXXTfGSp7/agent.337456
```

For the SSH_AUTH_SOCK to be populated, ssh agent forwarding also needs
to be enabled for SSH exec() calls; previously it was enabled only for
pty channels.

Since this commit changes the ABI of the mux protocol, the codec
version has been bumped.
2024-05-09 07:45:19 -07:00
Quan Tong
ba25f7df78 make activate-pane CLI honor unzoom_on_switch_pane 2024-05-05 13:16:50 -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
d22e97dcef
deps: update hostname to 0.4 2024-05-04 17:11:47 -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
845fa5d4ae
add notification_handling option to control suppression
refs: https://github.com/wez/wezterm/issues/3727
2023-09-28 18:05:18 -07:00
Quan Tong
cb2178e7d7 add zoom-pane subcommand 2023-08-28 21:58:22 -07:00
Wez Furlong
a103b6d97a
fix CloseCurrentPane leaving a stranded pane in a tab
Repro for this issue was:

```console
$ WEZTERM_LOG=mux=trace,info ./target/debug/wezterm -n --config 'exit_behavior="CloseOnCleanExit"'
```

Then:

* Split left/right
* CloseCurrentPane

refs: #4030
2023-08-28 07:28:23 -07:00
Wez Furlong
53988c7fe6
PaneSelect: add SwapWithActiveKeepFocus
refs: #3014
2023-08-24 22:32:19 -07:00
Wez Furlong
0499ab0430
mlua 0.9 is now stable; update 2023-08-17 09:26:47 -07:00
Wez Furlong
d1d4db20be
cargo update
Transitive deps now require rust 1.71, so update for that, as well
as some other minor changes required by transitive deps.
2023-07-30 20:09:15 -07:00
Wez Furlong
360247fe8d
windows: remove positional mods from termwiz overlay panes
otherwise, the termwiz line reader can become confused and
fail to recognize key presses like `(` which have SHIFT and LEFT_SHIFT
set.

refs: https://github.com/wez/wezterm/issues/3999
2023-07-16 09:45:22 -07:00
Wez Furlong
feb9e11b33
termwiz: refactor terminal probing
Factor out the probe_screen_size method from the Terminal
trait and put it into a ProbeCapabilities struct.

This makes it easier to introduce other sorts of probed
information without making the Terminal trait grow all sorts
of additional methods.

A Terminal may choose not to support probing, which it cannot
if it doesn't have Read + Write handles to an underlying terminal
(such as some special cases in wezterm).
2023-07-16 06:53:17 -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
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
Wez Furlong
46e14461eb
mux: improve domain name is invalid error message
refs: #3907
2023-07-11 08:11:39 -07:00
Wez Furlong
b9c23d19a1
new exit_behavior_messaging option
Controls the message that is shown when holding a pane open
after a process has completed.

refs: #3423
2023-07-10 17:14:48 -07:00
Rémi Labeyrie
da2c035ad2 feat: handle horizontal mousewheel events 2023-07-10 12:55:13 -07:00
Wez Furlong
c399ee665a
hold pane open when spawn fails
Show the error message in the pane itself when a spawn attempt
fails, regardless of the exit_behavior setting.

refs: #3950
refs: #3928
2023-07-09 13:53:41 -07:00
Wez Furlong
c2f1be53ba
Fix divide by zero when resizing lots of tiny panes
refs: #3921
2023-07-09 13:10:18 -07:00
Wez Furlong
01fe53f20a
ssh: use double height text for host key failure case
That makes it really stand out

refs: #3941
2023-07-06 12:53:05 -07:00
Wez Furlong
25361e028b
ssh: fix typo
refs: #3941
2023-07-06 10:44:50 -07:00
Wez Furlong
9e36775acf
ssh: improve host key verification error messaging
See screenshots attached to #3941 to see how it renders
2023-07-06 10:42:58 -07:00
Wez Furlong
6be3f0e7ca
ssh: rewrite exit_behavior=Close -> CloseOnCleanExit during connection
ssh connection or host authentication errors would not be displayed
when the config was in its default exit_behavior=Close state.

This commit introduces some plumbing to allow a pane to override
the effective exit_behavior value, so that ssh sessions can now
rewrite it to CloseOnCleanExit while they are in the process
of connecting.

refs: #3941
2023-07-06 09:28:43 -07:00
Wez Furlong
62c40118dd
mux: more consistently set WEZTERM_UNIX_SOCKET in localdomain
When spawning, ensure that we set WEZTERM_UNIX_SOCKET to our
current value to match the PANE that we export.

refs: #3679
2023-05-29 19:29:46 -07:00
Wez Furlong
c1147720bc
remove old paste chunking logic
I believe that this was obsoleted long ago by the ThreadedWriter
logic that is present in the terminal implementation so we no
longer need to limit the write chunk size.

refs: #3683
2023-05-29 15:10:57 -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
c8b8e81171
rustfmt 2023-04-11 22:16:43 -07:00
Peter Collingbourne
119036ab2a Do not wait indefinitely when being drip fed input.
If the client program is drip feeding us input at a rate faster than 1
character per mux_output_parser_coalesce_delay_ms (e.g. it is printing
output read from a serial port faster than this), we would previously
wait indefinitely for new input, because we would always poll with a new
timeout [...]delay_ms in the future. In the worst case, this would create
a busy loop that starves the other panes of an opportunity to read from
their ptys, making all of them unresponsive. Address this by making a
note of when the first character was read, and do not wait longer than
[...]delay_ms after this time.

Fixes #3466.
2023-04-11 22:04:06 -07:00
Wez Furlong
fa0f538d36
mux: detect dead ssh session and reconnect
The issue was that the session was rendered dead/unusable by closing
all of the tabs.

We now detect this and create a new session.

refs: https://github.com/wez/wezterm/discussions/3480#discussioncomment-5567569
2023-04-10 20:47:17 -07:00
Wez Furlong
947d242fda
mux: improve error messaging
https://github.com/wez/wezterm/discussions/3480#discussioncomment-5567569
mentioned that running `wezterm cli spawn --domain-name SSH:foo`,
closing that tab and running `wezterm cli spawn --domain-name SSH:foo`
again failed.

The error message had no useful context.

This commit adds more context.
2023-04-10 20:14:58 -07:00
Wez Furlong
62256c80b4
config: defer evaluating default wsl domains
The stack trace in https://github.com/wez/wezterm/issues/3425
shows a recursive borrow triggered indirectly by spawning
a subprocess and having that trigger the wndproc.

This commit doesn't really fix the recursive problem, but may
sidestep it, and it's probably best to avoid always running
the `wsl` command to get this list anyway, similar to the
change in 25255d90d6

refs: https://github.com/wez/wezterm/issues/3425
2023-04-08 08:51:47 -07:00
Wez Furlong
7b40f01054
switch to fancy-regex crate
Enables back references and look around assertions for quick select
and hyper link rules

refs: https://github.com/wez/wezterm/issues/3247
2023-04-07 17:39:00 -07:00
Wez Furlong
2843adb680
fix build on windows 2023-04-06 17:26:35 -07:00
Wez Furlong
0ca050e09d
expose the tty name associated with a pane 2023-04-06 17:13:07 -07:00