1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-26 14:54:16 +03:00
Commit Graph

1254 Commits

Author SHA1 Message Date
Abby Edwards
1b2baa5f76 Preserve clipboard contents on single left click 2020-04-05 19:32:59 -07:00
Wez Furlong
fe89082764 termwiz: remove Position::NoChange, fixup multiline line editing and moar!
This is unfortunately a bit of a muddy commit and I'm too lazy to split
it up.

* Removed `Position::NoChange`; use `Position::Relative(0)` instead
* Added missing cursor positioning cases in the terminfo renderer
* Taught line editor about the cursor position when the line spans
  multiple physical lines
* Taught the Windows input layer to process escape sequences for eg:
  the arrow keys when running with virtual terminal enabled.
* Removed the hack that under-reported the terminal width; the hack
  was present to make some aspects of rendering with the native windows
  console logic easier, but it was getting in the way of the line
  editor.  This may well break something, but it fixed up the line
  editor :-/

cc: @markbt
2020-04-05 11:14:08 -07:00
Wez Furlong
e6cc28a813 mux: use approx rtt to decide whether to use predictive echo
We'll only use it if it looks like the latency is over 100ms.
2020-03-31 08:41:53 -07:00
Wez Furlong
013288b1ef mux: grey out the terminal contents when tardy
The predictive echo feels pretty reasonable, but if the connection
is having problems and we're showing the tardiness indicator, the
echo can give the impression that your input is going to get processed.
That may not be (usually is not!) the case.

This commit makes it a bit more visually distinctive that something
isn't right by greying out the color palette in that case.

refs: https://github.com/wez/wezterm/issues/127
2020-03-14 08:57:35 -07:00
Wez Furlong
382b8f53dd predictive echo: make the password check more broad 2020-03-13 21:14:05 -07:00
Wez Furlong
9d89241a66 mux: add input event serial number to key events and render responses
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.
2020-03-10 08:34:47 -07:00
Wez Furlong
e7d8068ad9 connui: add a sleep_with_reason method
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.
2020-03-08 10:00:08 -07:00
Wez Furlong
446b3f7fd5 mux: improve predictive local echo
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
2020-03-08 08:36:52 -07:00
Wez Furlong
061d53bcfa mux: add basic "predictive" local echo
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
2020-03-07 21:53:46 -08:00
Wez Furlong
aae1d5cdb4 mux: set a limit on the line cache
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.
2020-03-07 20:59:33 -08:00
Wez Furlong
a23699790c CMD-T/CTRL-SHIFT-T: DefaultDomain -> CurrentTabDomain
This used to be effectively the same thing, but now that the launcher
menu allows attaching to other domains, it is best if the hotkey
matches the behavior of the + button on the tab bar and uses the
domain of the current tab instead.
2020-03-07 18:53:45 -08:00
Wez Furlong
70e18c74aa serial: fix a bug where baud rate was not applied 2020-03-07 17:09:43 -08:00
Wez Furlong
e7c61bd62e remove stray debug line! 2020-03-06 09:38:04 -08:00
Wez Furlong
242e386eb7 improve error output in connection ui
* 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.
2020-03-06 09:34:09 -08:00
Wez Furlong
6df260219a mux: improve how we handle EOF on a given tab
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.
2020-03-06 08:44:46 -08:00
Wez Furlong
57ab4c8f99 lua: add function to test if we're running in wsl 2020-03-06 07:20:22 -08:00
Wez Furlong
3742071a9b improve OSC 7 / cwd handling when dir doesn't exist
Hadn't noticed this until just now because the systems I've been
using have all had a pretty similar filesystem layout.

This commit avoids a failure to spawn a child process when the
desired directory doesn't exist locally.
2020-03-05 08:07:54 -08:00
Wez Furlong
58310627be launcher: show some domain details
Show the type of mux connection and the destination host alongside
the convenient name from the user's config.
2020-03-03 08:25:11 -08:00
Wez Furlong
0bf67d7b69 fix dismissing overlays with other mouse clicks 2020-03-03 07:52:09 -08:00
Wez Furlong
2debfcc624 remove some debug output 2020-03-03 07:51:47 -08:00
Wez Furlong
d7b5853c44 enable mouse input for tab navigator 2020-03-02 22:23:13 -08:00
Wez Furlong
dc3f2f0572 add launcher overlay
This is accessible by right-clicking on the `+` button in the tab bar
and switches to an overlay offering options to spawn tabs and attach
domains.

The intent is to allow the configuration file to expand this list of
options, and on Windows, to auto-populate with the various combinations
of `cmd`, `powershell`, `elevated` and available `wsl` instances, but
for the moment the main value of this feature is the ability to attach
domains that were not set to connect automatically at startup.

This makes things more convenient when launching wezterm via the
gui: it is awkward to have to set up shortcuts that run
`wezterm connect foo`, or to type in the full path to `wezterm` when
you might want to run that manually.

Now you can double-click the icon and right-click the `+` and attach
the domain. (cc: @rjwalsh)

The launcher is a good candidate for being implemented on top of
native context menus where available... but we don't have any
such API plumbed through the `window` crate, so all platforms
get the wonderful terminal based overlay menu right now.

refs: https://github.com/wez/wezterm/issues/159
2020-03-02 09:12:58 -08:00
Wez Furlong
c5e172534f split tab navigator into separate module 2020-03-01 17:16:38 -08:00
Wez Furlong
53055c2dda right clicking on a tab shows the tab navigator 2020-03-01 16:44:36 -08:00
Wez Furlong
fa0fd37f21 lua: keys: add some action plumbing
This commit tackles a couple of things in related areas:

Makes it possible to reference the KeyAssignment type directly from the
KeyAction action type.  Previously, due to limitations in how TOML is
serialized, the enum values could be used here; while the compiler would allow
it, it is impossible to construct a TOML value for this sort of enum.  Now that
we have lua we have more flexibility in the table type and this is unblocked.
In practical terms this means that we can do away with the janky `arg` field
and just use the `action` field directly, which also means that we can do away
with a whole extra enum that duplicates just the enum variants and makes
maintenance easier!

Adds `wezterm.action` to lua which helps to construct these enum variants.  The
helper is used like this in the `.wezterm.lua` file:

```lua
local wezterm = require 'wezterm';
return {
   keys = {
     {key="{", mods="SHIFT|CTRL", action=wezterm.action{ActivateTabRelative=-1}},
     {key="}", mods="SHIFT|CTRL", action=wezterm.action{ActivateTabRelative=1}},
   }
}
```

the above creates values like `KeyAssignment::ActivateTabRelative(-1)`
in a not totally awful syntax.

On top of this, which was the main reason for doing this work, this
commit adds two new variants to KeyAssignment that are accessible
on from lua (because of the TOML limitations mentioned above);
`SpawnCommandInNewWindow` and `SpawnCommandInNewTab` that take a
`SpawnCommand` struct as their parameter.  These actions are
conceptually similar to the existing `SpawnTab` key assignment
but allow specifying the program to be run as well as its cwd
and environment.

For example, this key assignment spawns `top` in a new window:

```lua
  {key="y", mods="CMD", action=wezterm.action{SpawnCommandInNewWindow={
    args={"top"}
  }}},
```

The intent is to use this as a building block for saved/canned
commands.

refs: https://github.com/wez/wezterm/issues/159
2020-03-01 14:17:35 -08:00
Wez Furlong
2bb37f0b79 lua: fixup error messages in tests 2020-03-01 11:03:37 -08:00
Wez Furlong
b1b24b48ec lua: make it easier to write type-safe functions
implementing the `ToLua` and `FromLua` traits allows `create_function`
to automatically apply the appropriate conversions to the parameters
and return values in a callback function.

That makes it possible (and nicer!) to write properly typed callbacks.
2020-03-01 10:55:17 -08:00
Wez Furlong
72097cbfbb lua: add wezterm.font_with_fallback
Can be used to specify explicit font fallback:

```
return {
  font = wezterm.font_with_fallback({"Operator Mono", "DengXian"}),
}
```
2020-03-01 10:12:53 -08:00
Wez Furlong
5f13e487ce lua: give a nice error message when using an invalid field name
Make a reasonable suggestion to the user based on similarity with
possible field names, but don't error out.

This facilitates evolving the configuration over time, and makes
the config more forgiving of typos.
2020-03-01 09:39:14 -08:00
Wez Furlong
d22a664bdb lua: slightly improve serde related error output 2020-03-01 08:04:06 -08:00
Wez Furlong
958ff864f7 config: allow defaulting a couple of fields for key assignments 2020-03-01 07:31:05 -08:00
Wez Furlong
8b9fcd3063 lua: use to_lua_value for wezterm.font
This is now more type-safe and clearer to read.
2020-02-29 22:04:34 -08:00
Wez Furlong
fa01ca59ca lua: add serde-powered to_lua_value function
This will help in implementing lua helper functions for various
config and other structures.
2020-02-29 21:46:59 -08:00
Wez Furlong
a6fb3971c6 fix an issue where config was not reloaded when changed
Weirdly, this seemed specific to lua files rather than toml files,
which I don't have a good explanation for.  When saving the file
in vim, we'd get a NoticeRemove but no Remove event.

This commit synthesizes the equivalent of a Remove after a NoticeRemove
and a slight delay.
2020-02-27 22:36:26 -08:00
Wez Furlong
7053021045 make it easier to debug why a given config file is being used 2020-02-27 21:21:13 -08:00
Wez Furlong
0e01929caa mux: try to avoid shuffling tabs on tls connections
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
2020-02-27 20:15:04 -08:00
Wez Furlong
52e4837fe2 lua: add wezterm.hostname() function
This enables host-specific conditional logic in the config file
2020-02-27 08:10:03 -08:00
Wez Furlong
0792f43739 config: increase default output ratelimit
For full screen terminals it is common for scrolling through vim
to hit the prior default limit.  This value feels better.  This
comes at the cost of an increased delay for eg: CTRL-C processing
in the case where something is spamming the terminal, but that
is relatively rare.
2020-02-27 07:46:04 -08:00
Wez Furlong
7da463f413 lua: add helper for setting fonts
This tidies up the part of the config syntax that I most disliked:

```lua
  font = {
    font = {{
      family = "Operator Mono SSm Lig Medium",
    }},
  },
```

can now be as simple as:

```lua
  font = wezterm.font("Operator Mono SSm Lig Medium"),
```

Here's the font related section from my config:

```lua
local wezterm = require 'wezterm';

return {
  font = wezterm.font("Operator Mono SSm Lig Medium"),
  font_rules= {
    {
      italic = true,
      font = wezterm.font("Operator Mono SSm Lig Medium Italic"),
    },

    {
      italic = true,
      intensity = "Bold",
      font = wezterm.font("Operator Mono SSm Lig Book Italic"),
    },

    {
      intensity = "Bold",
      font = wezterm.font("Operator Mono SSm Lig Bold", {foreground = "tomato"}),
    },

    {
      intensity = "Half",
      font = wezterm.font("Operator Mono SSm Lig Light"),
    },
  },
}
```
2020-02-27 07:39:07 -08:00
Wez Furlong
ab03147bd9 config: we can now read ~/.wezterm.lua
This allows for slightly more fancy configuration in the future, but for
now it is rather simple: your lua script returns a configuration struct
with the same shape as that from the TOML file.

A `wezterm` module is provided to the script that provides some
constants to help understand the environment in which wezterm
is running.

I want to add some helpers that make setting up the fonts feel less
weird (lots of nesting in the data model makes this weird).

The ability to conditionally construct configuration is powerful
and helps to address the broader request in
refs: https://github.com/wez/wezterm/issues/152

An example config looks like this:

```lua
local wezterm = require 'wezterm';

print(wezterm.config_dir);
print(wezterm.executable_dir);
wezterm.log_error("w00t! running " .. wezterm.version
  .. " on " .. wezterm.target_triple ..  " " .. wezterm.home_dir);

return {
  enable_scroll_bar = true,
  enable_tab_bar = true,
  ratelimit_output_bytes_per_second = 400000,
  scrollback_lines = 350000,
  font_dirs = {".dotfiles/fonts"},

  window_padding = {
    left = 2,
    bottom = 2,
  },

  font = {
    font = {{
      family = "Operator Mono SSm Lig Medium",
    }},
  },

  unix_domains = {
    {
      name = "unix",
    }
  },

  ssh_domains = {
    {
      name = "localhost",
      remote_address = "localhost",
      username = "wez",
    },
  },

  tls_clients = {
    {
      name = "cubetls",
      remote_address = "cube-localdomain:8080",
      bootstrap_via_ssh = "cube-localdomain",
    },
  },

  tls_servers = {
    {
      bind_address = "192.168.1.8:8080",
    },
  },

  hyperlink_rules = {
    {
      regex = "\\b\\w+://(?:[\\w.-]+)\\.[a-z]{2,15}\\S*\\b",
      format = "$0",
    },
  },

  font_rules= {
    {
      italic = true,
      font = {
        font = {{
          family = "Operator Mono SSm Lig Medium Italic",
        }}
      },
    },

    {
      italic = true,
      intensity = "Bold",
      font = {
        font = {{
          family = "Operator Mono SSm Lig Book Italic",
        }}
      },
    },

    {
      intensity = "Bold",
      font = {
        foreground = "tomato",
        font = {{
          family = "Operator Mono SSm Lig Bold",
        }}
      },
    },

    {
      intensity = "Half",
      font = {
        font = {{
          family = "Operator Mono SSm Lig Light",
        }}
      },
    },
  },
}
```
2020-02-26 22:11:23 -08:00
Wez Furlong
b46d2f054a mux: unset misc env vars when starting the mux server 2020-02-24 08:24:33 -08:00
Wez Furlong
54047e357a export WEZTERM_CONFIG_DIR and WEZTERM_EXECUTABLE_DIR
To make things more convenient on Windows, export the directories
as well as the file names that we discovered.

refs: https://github.com/wez/wezterm/issues/152
2020-02-24 08:03:59 -08:00
Wez Furlong
9b4ddde908 mux: don't panic the server if the client disconnects
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.
2020-02-23 10:38:46 -08:00
Wez Furlong
65749f06a3 mux: fix poll interval. show update indicator
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
2020-02-23 09:08:04 -08:00
Wez Furlong
c9064c3f90 mux: don't give up tls connection for connrefused
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.
2020-02-22 19:26:25 -08:00
Wez Furlong
4af4ad77b5 split out MouseState/Renderable/ClientTab 2020-02-22 14:54:27 -08:00
Wez Furlong
5a2d2b3163 prepare to break up src/server/tab.rs 2020-02-22 13:07:45 -08:00
Wez Furlong
18294841e9 ssh2: update to 0.8
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.
2020-02-22 08:50:13 -08:00
Wez Furlong
097092b36d mux: try harder to re-attach to tabs on reconnect
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
2020-02-22 07:29:27 -08:00
Wez Furlong
1ac0358cb8 mux: attempt to reuse tls creds on reconnect
Try to avoid running through the SSH authentication flow if we
previously bootstrapped via SSH and already have a local cert.
2020-02-22 07:14:42 -08:00
Wez Furlong
ee3156888f tab overlay: allow selecting tab by number 2020-02-21 08:44:35 -08:00
Brendan Cully
95fb9c08ca Cleanup: let structopt parse ssh user/host/port instead of doing it by hand
Implement FromStr and Display for SshParameters, so that they can be
parsed and displayed in the standard way.

The motivation for this is that I want to add gateway hosts to the ssh command, and
would like to be able to add something like `gateway: Vec<SshParamters>` to SshCommand
to do it.
2020-02-17 21:39:51 -08:00
Wez Furlong
6f8af46def export WEZTERM_EXECUTABLE and WEZTERM_CONFIG_FILE to the env
This allows child processes to "do something" with that information.
For example, portable wezterm deployments can use these paths to
bootstrap some other portable config paths.

refs: https://github.com/wez/wezterm/issues/152
2020-02-16 09:36:31 -08:00
Wez Furlong
2522b276cc fix inverted logic when warning about not finding a font in font_dirs 2020-02-14 12:38:04 -08:00
Wez Furlong
ff210a1c8e tweak font parser/locator to recognize Regular as a sub family 2020-02-14 12:35:42 -08:00
Wez Furlong
0b3f61796a macos: change default font to Andale Mono
The other default available macos monospace fonts have ligatures for
"fi" that are configured such that harfbuzz will render them when they
are part of a word like "finish" which results in a very weird
appearance.
2020-02-14 12:12:00 -08:00
Wez Furlong
1357a7f25a Enable timestamps in the logger 2020-02-14 09:46:19 -08:00
Wez Furlong
754f8166b5 Add HideApplication and QuitApplication key assignments
```
[[keys]]
key = "q"
mods = "CMD"
action = "QuitApplication"
```

refs: https://github.com/wez/wezterm/issues/150
2020-02-14 08:49:15 -08:00
Wez Furlong
412d0de7f5 rustfmt 2020-02-10 22:23:18 -08:00
Wez Furlong
0242cb7007 Add a minimum tab width for the tab bar
This is a soft minimum rather than a hard minimum, and is not
configurable.

refs: https://github.com/wez/wezterm/issues/147
2020-02-10 22:14:15 -08:00
Wez Furlong
dedce44c54 reattach tabs when reconnecting to a domain
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
2020-02-10 22:14:15 -08:00
Wez Furlong
79d8342a9d improve portability of window path/uri check for osc 7 2020-02-09 13:16:08 -08:00
Wez Furlong
65707aba56 allow setting default values for environment variables
This is useful for setting up a reasonable initial environment.
For example, on Windows you might want to set the `prompt` environment
so that some basic shell integration is enabled; this will cause new
tabs to open with the same cwd as the current tab:

```
set_environment_variables = { "prompt"="$E]7;file://localhost/$P$E\\$P$G" }
```

This setting is intended to apply only to the local domain.

refs: https://github.com/wez/wezterm/issues/146
2020-02-09 12:55:04 -08:00
Wez Furlong
15e875f765 make setting tab bar colors more ergonomic
closes: https://github.com/wez/wezterm/issues/148
2020-02-09 09:34:59 -08:00
Wez Furlong
d73a37be24 plumb OSC 7 cwd through to windows pty layer
This allows this prompt setting to work:

```
prompt $E]7;file://localhost/$P$E\$P$G
```

although this one sets it for future prompts:

```
setx prompt $E]7;file://localhost/$P$E\$P$G
```

refs: https://github.com/wez/wezterm/issues/146
2020-02-09 09:10:26 -08:00
Wez Furlong
1a50075ae6 windows: remove gross wsl spawning workaround
This doesn't appear to be needed anymore (perhaps is windows build
dependent?) and removing it is the nicer, cleaner thing to do.
2020-02-09 08:40:51 -08:00
Wez Furlong
9558fbe6a4 Added hide_tab_bar_if_only_one_tab config option
refs: https://github.com/wez/wezterm/issues/143
2020-02-08 08:15:36 -08:00
Wez Furlong
7d94aaa475 Added initial_rows, initial_cols configuration
Allows specifying the size of new windows.

Refs: https://github.com/wez/wezterm/issues/142
2020-02-07 21:43:12 -08:00
Wez Furlong
c7012dec9b refactor: move PDU handling logic to sessionhandler
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.
2020-02-03 07:46:52 -08:00
Wez Furlong
a8a0ad579e move the umask setting to happen earlier 2020-02-02 20:42:21 -08:00
Wez Furlong
2489abf9cb connui: accommodate multi-line 2fac prompts
This fixes up the cursor position when the remote host sends
a multi-line prompt.
2020-02-02 17:01:31 -08:00
Wez Furlong
6fb4d61dc0 fix default timeout for default unix domain 2020-02-02 15:44:49 -08:00
Wez Furlong
7257cf18c2 add some more diagnostics for mux connections
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
2020-02-02 15:02:30 -08:00
Wez Furlong
cb9ec2fa2a biffed: native_tls
We use openssl on all platforms now
2020-02-02 13:03:07 -08:00
Wez Furlong
fa4bddd943 mux: improve error handling around ssh bootstrap and tls setup
Work a bit harder to capture more context and log it.

As of this commit, windows is now able to use openssl to connect to
a remote mux over TLS.
2020-02-02 13:03:07 -08:00
Wez Furlong
274d22edda tls: revisit cargo features
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.
2020-02-02 13:03:07 -08:00
Wez Furlong
9b02089849 mux: tls: auto-bootstrap via ssh
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.
2020-02-02 13:03:07 -08:00
Wez Furlong
d2080a4e90 mux frontend: don't panic during shutdown
We could panic with a send error during shutdown in some cli/proxy
related cases.  Avoid that.
2020-02-02 13:03:07 -08:00
Wez Furlong
b5e22941f3 connui: don't panic if the user closes the window while in use
If we're actively outputting to the window and the user closes it,
we don't need to panic.

Make the window a little larger now that it shows more data.
2020-02-02 13:03:07 -08:00
Wez Furlong
28243b2a32 mux: sound groundwork for auto pki
This is a step towards automatic management of TLS certs for the
mux stuff.
2020-02-02 13:03:07 -08:00
Wez Furlong
18a45657be mux: add read and write timeout options for sockets
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.
2020-02-02 13:03:07 -08:00
Wez Furlong
096d18c440 connection ui: pull up a level
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.
2020-02-01 08:28:05 -08:00
Wez Furlong
f6df70a1df blow shaper cache when config is reloaded
It may be fine to preserve across a reload, but it doesn't hurt
much to blow it to be sure.
2020-01-27 20:56:47 -08:00
Wez Furlong
f5568b777b add font shaping lru cache
I'm adding this primarily to avoid repeatedly showing "No more
fallbacks" errors when moving the mouse over a terminal that contains
cells with no matching glyphs.

It has the nice side effect of changing the typical opengl tab render
time from ~2.9ms to ~1.3ms.
2020-01-27 20:48:01 -08:00
Wez Furlong
c778307b0e macos: fix light background/border
The opengl based render first clears the window to the background
color and then renders the cells over the top.

on macOS I noticed a weird lighter strip to the bottom and right of
the window and ran it down to the initial clear: our colors are SRGB
rather than plain RGB and the discrepancy from rendering SRGB as RGB
results in the color being made a brighter shade.  This was less
noticeable for black backgrounds.
2020-01-26 19:04:34 -08:00
Wez Furlong
d19db3c87b middle click on a tab to close it
Closes: https://github.com/wez/wezterm/issues/123
2020-01-26 10:21:47 -08:00
Wez Furlong
f41d82a254 remove some dead TerminalHost code 2020-01-26 08:55:56 -08:00
Wez Furlong
f125bd863a remove dead click_link method from terminal host
This is now handled by the gui layer
2020-01-25 23:17:45 -08:00
Wez Furlong
cdbb131833 mux: respect color scheme option for remote tabs 2020-01-25 23:05:02 -08:00
Wez Furlong
d52881a04e overlay: tab navigator fix down arrow
We'd allow going off the bottom of the list; fix the math to limit it
2020-01-25 22:42:13 -08:00
Wez Furlong
1c7e0d4e20 remove some debug prints 2020-01-25 22:32:01 -08:00
Wez Furlong
50d07acf99 Flesh out the tab navigator overlay
We now display a list of tabs and allow selecting them with either
the up/down arrows or the k/j keys.  Enter activates the selected
tab, Escape cancels the overlay.
2020-01-25 19:16:23 -08:00
Wez Furlong
42379d4edf remove unused local variables 2020-01-25 17:18:45 -08:00
Wez Furlong
ff82b63fb8 alt-9 pops up an overlay on the current tab
This is placeholder for the moment, but proves the concept
2020-01-25 17:18:45 -08:00
Wez Furlong
3940684b4e respect color scheme for termwiz derived tabs 2020-01-25 17:18:45 -08:00
Wez Furlong
0822c67e32 overlay: initial prep
An overlay is a little termwiz app that can be overlaid over the
content of a gui tab.

The intent is for these to provide the mechanism for meta operations;
listing all tabs in a long-form list and switching between them,
dropping into configuration or error log review and so on.
2020-01-25 17:18:45 -08:00
Wez Furlong
78ab99e0d0 avoid allocating an empty window id
This prevents logging a message about a window being removed
from being printed at startup when connecting to a remote mux.
2020-01-25 17:18:45 -08:00
Wez Furlong
eff682e0bb add connecting status UI for mux connection attempts
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
2020-01-25 15:58:12 -08:00
Wez Furlong
1fe9e16f25 refactor ssh connection ui into its own module
I want to re-use this for the mux client
2020-01-25 15:10:34 -08:00
Wez Furlong
fd8f28960f ssh: use a single window for authenticating a session
This makes it so that we preserve context while showing the connection
status and authentication prompts.
2020-01-25 13:00:16 -08:00