This should allow some basic reasoning about how in sync we are with
the remote system.
The immediate application of this is to try to avoid wiggling the
text cursor when the predictive echo updates the position locally.
I need to push this in order to test it on my higher latency setup,
so I don't know if this is totally effective yet.
This is used to indicate timeout/retries during connection establishment
and also to count down to the automatic window close.
The UI will render a progress bar underneath the reason text to show
the passage of time, as well as counting down the provided duration.
Extends the "predictions" to allow for some basic cursor movement
via cursor keys and text deletion.
In addition, show predictions for pasted text.
refs: https://github.com/wez/wezterm/issues/127
This is a mosh-like feature, but not as sophisticated.
The goal is to reduce perceived latency by making a reasonable
guess about how the line where the cursor is located will change
in response to a key press.
At the moment the guess has some very basic heuristics:
* The key is an unmodified (no CTRL, ALT, SUPER) `char` value
* The line containing the cursor doesn't appear to be a
password prompt (using a very simple English specific test)
In those conditions, we'll update the local line cache and cursor
position with how we think the text will appear, but we set the
underline attribute (which is relatively rarely used) to make it clearer
that this is synthetic.
For low latency environments (eg: local network) the underline
rarely appears unless you are able to type very quickly.
I've yet to test this on a higher latency link, but think
this is good enough to land and build out so that I can test
that scenario with my work systems.
refs: https://github.com/wez/wezterm/issues/127
I made this unbounded originally because I wanted to do something
smarter around config reloading. I'm still too lazy to make it
do that, but do recognize that we should have some limit on the
line cache size, so we just pick the value of the scrollback
size at the time we started.
* Increase timeout from 2 to 10 seconds, giving you more time to read it
* Make the timeout work even if the UI object is unexpectedly destroyed
* When attaching via the launcher, don't reconnect when the server
version mismatches the client version.
This adjusts the mux protocol so that we can tell when a remote tab
has been closed; previously we couldn't distinguish between an IO
error and the tab going away.
Similarly, if the remote mux has shut down (which we detect via an EOF),
then we won't try to reconnect and will proceed to detach that domain.
If we hit a timeout for a tab we could mark it dead and remove it
from the containing window. This isn't desirable for a tls
session that we can reconnect, in part because the timeout is
likely to happen to the last focused tab if connectivity was
suddenly lost (that was the one we were interacting with, so are
likely to have PDUs about to go out), so only that one gets marked
dead and removed from the GUI.
When we re-attach later we may place the tab in the wrong ordinal
position, which is annoying.
This commit seeks to avoid the annoyance by not marking the tab
dead for reconnectable transports.
refs: https://github.com/wez/wezterm/issues/127
I saw that the server exited with a panic here in the case that the
connection was torn down and left the channel broken. We don't need
to terminate in this case and can simply ignore the error.
Add an update indicator to the top right of client tabs; this is
overlaid on top of the surface when the last update from the server was
more than ~3s ago and if we expected it sooner than that.
While making this work, I noticed that the exponential poll backoff
had gotten broken in an earlier refactor; instead of a series of polls
backing off slowly, we were aggressively running the backoff up to the
max 30 second interval over the span of a few ms. This commit fixes
up the backoff computation to only happen when we are ready to send
a poll.
refs: https://github.com/wez/wezterm/issues/127
When we're trying to use credentials from a session that was previously
bootstrapped via ssh but hit connection refused (eg: the server was
subsequently shut down), then we want to proceed to attempting to
re-boostrap via ssh.
That version has the ability to use SSH agent forwarding.
This commit doesn't enable that functionality, it's just updating
the version and adjusting for changes in the upstream.
If we'd decided to close a tab due to an error bubbling up in the
reader, we need to re-assign a local id when we enumerate tabs.
This is a bit of a crutch: ideally we'd not close the tab and
instead show some kind of UI to indicate that it is not responding.
refs: https://github.com/wez/wezterm/issues/127
This helps to restore any individually dropped tabs and to detect
tabs that were created by other clients across a reconnection.
refs: https://github.com/wez/wezterm/issues/127
This is conceptually slightly cleaner and allows sessionhandler to
be agnostic of the details of the channel used to communicate with
the client; it just has a Sender<DecodedPdu> to work with.
I suspect some race condition because adding these made the connect
time hang stop reproducing for me on my local network.
Will try this to the corp vpn.
refs: https://github.com/wez/wezterm/issues/127
This commit adjusts the features in Cargo.toml to allow building
without openssl on unix systems.
It teaches the native_tls flavor of the code to perform bootstrapping
via ssh, but is still not usable because there still isn't a way
to get native_tls to use PEM files.
This makes the tls channel much easier to use; the config can now be as
simple as this on the server side:
```toml
[[tls_servers]]
bind_address = "192.168.1.8:8080"
```
and this on the client side:
```
[[tls_clients]]
name = "hostname"
bootstrap_via_ssh = "192.168.1.8"
remote_address = "hostname:8080"
```
and then `wezterm connect hostname` will use ssh to connect to the
host, start the mux server, request the CA and client certs and
then connect to it over TLS.
This is implemented only for openssl at the moment.
Adds a default 60 second timeout for read and write for the tls
and unix domain sockets that we create. This applies to ssh
domains, but not `wezterm ssh` sessions that go direct to ssh ptys.
I noticed that the reconnection UI for TLS mux sessions was annoying
on macOS: it would flash up and steal the focus, make a connection
attempt that would immediately fail because the destination was not
routable and then close the window. It would do this each time
a connection attempt was made (every few seconds in the early
stages of backoff).
This commit pulls the UI up a level so that we open the window at
the start of the connection (or re-connection) attempt, and keep
the same one for its lifetime.
This also introduces a headless UI object that doesn't output or
respond to anything. You can set the log level to trace to see
what is happening inside. It is used by the CLI mode. It could
perhaps be made smart enough to conditionally show a UI when needed,
but since it is targeting local unix domain sockets, that doesn't
seem like it is needed right now.
We now show a little status window when we're making a connection
for a remote mux domain.
This should make things feel slightly nicer if there is a connectivity
problem.
refs: https://github.com/wez/wezterm/issues/127
It's too fiddly to setup in practice, and literally no one has
expressed an interest in using it.
Removing it simplifies some upcoming work.
Closes: https://github.com/wez/wezterm/issues/35
While debugging on windows earlier today I saw that we were
blocked on this wait on the main thread. For whatever reason,
that only blocks in practice on Windows; I suspect that this is
due to a timing issue on windows where the server side takes
longer to respond than it does on posix.