1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 03:09:06 +03:00
Commit Graph

4950 Commits

Author SHA1 Message Date
Wez Furlong
cefe45d206 Windows can be labelled with a workspace name
This is not exposed through any UX; the mux api allows setting
the workspace and propagating information about windows whose
workspace has changed.

Windows start with a blank workspace name.

This is just plumbing; nothing uses it yet.

refs: #1531
2022-01-12 16:47:08 -07:00
Wez Furlong
f6e56aab10 ci: tidy up termwiz workflow 2022-01-12 07:19:44 -07:00
Wez Furlong
4452fbe798 ci: trigger termwiz build on push as well 2022-01-12 07:16:16 -07:00
Wez Furlong
475fc0667b fix termwiz compilation when widgets are enabled
refs: #1457
2022-01-12 07:14:14 -07:00
Wez Furlong
9b9bd0ae8c mux: track list of clients
Define a way to compute a client ID and pass that through to the
mux server when verifying version compatibility.

Once associated, the session handler will keep some metadata
updated in the mux.

A new cli subcommand exposes the info:

```
; ./target/debug/wezterm cli list-clients
USER HOST              PID CONNECTED  IDLE      WORKSPACE
wez  mba.localdomain 52979 30.009225s 1.009225s
```

refs: #1531
2022-01-11 22:43:26 -07:00
Wez Furlong
e314d84711 wezterm connect unix could exit on startup
This is a similar race condition to one we had before with the
multiplexer, where the connection UI made us think that we didn't
need to start a new process.

Additionally, the attach method would unconditionally create a
new client without checking whether we already had one.
2022-01-11 22:35:31 -07:00
Wez Furlong
58d969e77c gui: Avoid 450ms delay on startup(!)
In the case that the published symlink is stale, our default
client connection logic was to retry connecting with backoff
to give a newly spawned server a chance to startup.

In the context of a newly launched gui process checking to see
if an existing gui process can serve the same request, we don't
need to give it any grace: it will either answer immediately
or be deemed not useful.

This commit limits us to a single connection attempt in the case
where we're not automatically starting the server, which in turn
constrains the overhead to something in the order of microseconds
rather than nearly 0.5 seconds.

While we're in here, I noticed that if we thought we had a socket
to try and that failed, we'd always try to publish a new symlink.
However, if we failed due to mismatched version info, we shouldn't
publish over the top of the already running instance.

refs: #1529
2022-01-10 20:31:01 -07:00
Wez Furlong
d1018c37ff docs: changelog for #1526 2022-01-10 18:56:57 -07:00
Wez Furlong
e40042e605 remove stray dbg! 2022-01-10 18:39:59 -07:00
Wez Furlong
1fd53d4a5d mux: propagate User Vars across to the client
user vars were stubbed out.  This commit adds storage for them
in the mux client and adds a new notification that publishes each
var as it is changed.  That differential stream is applied to the
storage in the mux client when it is received.

```lua
local wezterm = require 'wezterm'

wezterm.on("update-right-status", function(window, pane)
  local woot = pane:get_user_vars().woot
  window:set_right_status(tostring(woot))
end);

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

then running:

* `wezterm connect unix`
* in that session: `printf "\033]1337;SetUserVar=%s=%s\007" woot `echo -n nice | base64``

causes `nice` to show in the status area.

refs: #1528
2022-01-10 18:33:32 -07:00
Wez Furlong
3ae38eb5bf mux: synthesize PaletteChanged event when config is reloaded
This is slightly misusing or misattributing things, but in
the context of the problem at hand, it is OK.

The issue is that palette changes are normally signalled by
the terminal instance in response to escape sequences.  Those
changes are propagated to the mux client through the existing
alerting channel.

If the palette is changed implicitly via a config change, then
the terminal doesn't trigger that alert and the mux client(s)
don't know that they need to refresh the palette.

This commit tracks the last config generation per pane and
synthesizes a palette alert when it changes.

It might be better to have another variant of alert to indicate
config changes.

refs: #1526
2022-01-10 18:13:42 -07:00
Wez Furlong
a189bb57c1 mux: don't include unchanged lines in the bonus lines
This doesn't make a huge difference; I think we already addressed
the worst of the overhead with a combination of
eae327efcc
and the more recent commits to avoid over invalidation around
cursor movement and screen scrolling.

The numbers I see are a very small number of bytes per second when
scrolling through eg: vim and aren't crazy or alarming.

So I'm going to consider the related issue resolved!

closes: https://github.com/wez/wezterm/issues/867
2022-01-10 17:59:53 -07:00
Wez Furlong
0d18a40d60 improve some of our counters/stats 2022-01-10 17:59:53 -07:00
Wez Furlong
aa648797ae Include executable path and config path in version info
Use that to decide if the running version is equivalent to the
newly spawning one when deciding if we can route a command to it
or spawn a new gui
2022-01-10 17:59:53 -07:00
Wez Furlong
fc5c435949 stats: fix .size counters showing up as time counters 2022-01-10 10:36:33 -07:00
Wez Furlong
5d52902b4a invalidate fancy title bar before we potentially error out
This feels slightly more robust in the face of errors

refs: https://github.com/wez/wezterm/issues/1527
2022-01-10 08:31:10 -07:00
Wez Furlong
f48e2d9a85 SshDomain: assume_unix -> assume_shell = "Posix" 2022-01-10 08:27:09 -07:00
Wez Furlong
fe0488420b speculative fix for https://github.com/wez/wezterm/issues/1527
We need to invalidate the elements in the title bar if we reallocate
the quads, otherwise we'll be left with random stuff in the texture
coords.
2022-01-10 08:20:18 -07:00
Wez Furlong
1357480ce6 SshDomain: add assume_unix option; enables setting cwd for new panes
If we know that the remote host is a unix system, and that it uses some
version of the posix shell, then we can adjust our command line to cd to
the requested directory (as set by OSC 7) and then exec the requested
command.

That's what SshDomain::assume_unix indicates and what this commit does.
2022-01-09 21:32:09 -07:00
Chip Senkbeil
5042addb06 Add features to enable vendored-openssl for ssh2 and libssh-rs individually 2022-01-09 19:36:56 -08:00
Chip Senkbeil
1f17416e60 Support gating libssh-rs and ssh2 behind features of same name 2022-01-09 19:36:56 -08:00
Wez Furlong
b3987bec12 ssh: allow setting default_prog for SshDomain when multiplexing=None
```
return {
  ssh_domains = {
    {
      name = "woot",
      remote_address = "192.168.1.8",
      multiplexing = "None",
      default_prog = {"fish"},
    }
  },

  default_domain = "woot",
}
```

refs: https://github.com/wez/wezterm/issues/1456
2022-01-09 20:09:53 -07:00
Wez Furlong
a045cfe092 standardize on SshDomain as the way to configure RemoteSshDomain
refs: https://github.com/wez/wezterm/issues/1456
2022-01-09 19:45:11 -07:00
Wez Furlong
2f5f39b1dd cargo update, including updating zbus to 2.0.0 stable 2022-01-09 19:29:29 -07:00
Wez Furlong
79f7f63064 deps: ordered-float -> 2.10
closes: https://github.com/wez/wezterm/pull/1524
2022-01-09 19:25:48 -07:00
Wez Furlong
3593a288ea ssh: rename use_multiplexer to multiplexing
This puts us in a better position for the future to be able
to configure whether we use wezterm, tmux or no multiplexing.

Today we allow wezterm or no multiplexing.

Add docs on this new setting.

refs: https://github.com/wez/wezterm/issues/1456
2022-01-09 19:16:54 -07:00
Wez Furlong
f84c0632d8 gui: allow wezterm connect sshdomnomux
If an ssh domain is set to use_multiplexer=false, it is now
possible to `wezterm connect` to it.

Previously, it was only possible to connect to domains that
used the mux client.

refs: https://github.com/wez/wezterm/issues/1456
2022-01-09 15:52:40 -07:00
Wez Furlong
0676eed42f gui: refactor common code between ssh/connect/start subcommands 2022-01-09 15:25:00 -07:00
Wez Furlong
524663e9ce gui: refactor connect/ssh subcommands to share more code 2022-01-09 14:41:43 -07:00
Wez Furlong
59be1bf8ac wezterm ssh and wezterm serial: now support --class
Notice these were missing when compared to the other gui subcommands.
2022-01-09 13:18:08 -07:00
Wez Furlong
f69177b022 ssh: allow setting SshDomain::use_multiplexer = false
Currently has no effect.

refs: #1456
2022-01-09 13:13:54 -07:00
Wez Furlong
328aaaefd2 mux: ssh: RemoteSshDomain: defer session creation until spawn time
refs: #1456
2022-01-09 13:04:15 -07:00
Wez Furlong
80e7f0bd93 docs: missing lua from code block 2022-01-09 12:41:17 -07:00
Wez Furlong
8e0a92b2ec docs: WslDomain, default_domain, wsl_domains
refs: #1242
2022-01-09 12:23:14 -07:00
Wez Furlong
58ea5e4f11 docs: document wezterm ls-fonts 2022-01-09 11:40:37 -07:00
Wez Furlong
380a67dd85 gui: tidy up whether we use existing gui or publish as a new one
If we decide we want re-use and existing gui due to config differences
we shouldn't then publish the new, differently configured, gui as
the canonical path for that display/class.

Clarify the message that we print when re-using an existing gui
in case someone doesn't want that behavior.
2022-01-09 11:18:47 -07:00
Wez Furlong
42a13f63df cargo fmt 2022-01-09 11:12:14 -07:00
Wez Furlong
373c5900e8 changelog: associate Windows wait_message latency fix w/ more issues 2022-01-09 10:59:43 -07:00
Wez Furlong
0c73a2359f docs: changelog fix typo 2022-01-09 10:56:41 -07:00
Wez Furlong
b7e142f407 docs: revise changelog for xkbd composition changes 2022-01-09 10:55:57 -07:00
Wez Furlong
daf83b49a8 config: avoid ambiguous naming
weird that this doesn't error locally, but breaks CI
2022-01-09 10:47:29 -07:00
Wez Furlong
93c3a6381d docs: enable folding in navigation area
This helps to avoid being overwhelmed by the number of pages!

refs: https://github.com/rust-lang/mdBook/issues/1724
2022-01-09 10:13:07 -07:00
Wez Furlong
31f16375ed refactor: move Config into own module
That top level config/src/lib.rs has been too big for too long.
Break it up a little.

(I recommend running `cargo clean` if you're updating across
this change to avoid a rust ICE with it cached on-disk state)
2022-01-09 10:06:50 -07:00
Wez Furlong
3000223585 config: revise how skip-config (-n) works
Previously, it would skip loading the initial config and allow
loading it later by using the reload hotkey.  That reload behavior
was an accident!

Another problem with the old approach is that everything else was
set up as if the config had been loaded, which is now causing
confusion for code that wants to decide whether we are using
that configuration or not.

This commit formalizes the skip by remembering that state globally.

This change helps to simplify some special cases around command
line overrides as well, as well as allows cli overrides to take
effect when the user doesn't have a config file.
2022-01-09 09:33:02 -07:00
Wez Furlong
3ad91ff93e docs: changelog: note about allow_win32_input_mode option 2022-01-09 08:46:09 -07:00
Wez Furlong
41953ee5e9 docs: changelog revise wording around compose_cursor 2022-01-09 08:44:38 -07:00
Wez Furlong
627001762e rename dead_key_is_active -> composition_status, dead_key_cursor -> compose_cursor
Since the composition state isn't strictly tied to dead keys, use
a name that better reflects that.
2022-01-09 08:39:21 -07:00
Wez Furlong
ca69515e3b window: x11/wayland keyboard: try harder to populate Composing info
When a dead key is composing, we gave no information about what was
composing.  Contrast with Windows and macOS where we show the first
key in the composition as part of that state.

This commit makes an attempt to populate equivalent information.
It's a bit more complex with the xkeyboard stuff as there can be
multiple combining sequences and there's no guarantee that we can
show a meaningful label.

We try our best for the common case of a single dead key, and have
a probably reasonable fall back for other cases where we don't
other get that information.

This allows removing DeadKeyStatus::Holding.
2022-01-09 08:25:25 -07:00
Wez Furlong
430e34ad37 docs: missing changelog for https://github.com/wez/wezterm/issues/1459 2022-01-08 21:53:44 -07:00
Wez Furlong
3e99390299 LocalDomain: don't use global default_prog/default_cwd for WslDomains
They have their own versions of these options, and logically it doesn't
make sense to use the default_prog from the `local` domain with a wsl
domain.

refs: #1242
2022-01-08 16:07:22 -07:00