Commit Graph
15 Commits
Author SHA1 Message Date
Wez Furlong ca27f921e2 wezterm cli list-clients: add ssh_auth_sock to json, tidy up duration
Make longer durations a bit more intelligible.
Add the auth sock to the json format output from the command.
2024-05-10 08:27:05 -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
Wez Furlong 6b66b6674a mux: proxy: extract unix domain from connected client
This resolves an issue where `WEZTERM_UNIX_SOCKET=something wezterm cli
proxy` would use `something` for the unix domain path when checking that
an existing instance was up and running, but would then use the default
implicit socket path when dropping into the proxy passthrough stage.

What we do here is transform the connected client into its configuration
and use that instead of trying to re-derive the socket from incomplete
information.

The motivating example is using SSH to get into a workstation that
is running a GUI wezterm with no explicit unix domain mux.
2024-05-08 15:14:22 -07:00
Wez Furlong 4f123a461b macos (mostly): try harder to get initial dpi
There are a number of open issues that relate to getting the dpi
wrong when spawning a window. In theory it shouldn't matter because
we will immediately realize the difference and synthesize the correct
information, but evidence shows this isn't quite true.

What this commit does is:

* Override Connection::default_dpi() on macOS to return the
  effective_dpi from the active screen instead of the default
  non-retina dpi
* Adjust the Config::initial_size() method to accept an optional
  cell pixel dimension
* Add a helper function to wezterm-gui to compute the cell pixel
  dimensions given the config and the (usually default) dpi, and
  feed that through to Config::initial_size
* in the macos window impl, scale the computed geometry based on
  the ratio of the Connection::default_dpi and the default non-retina
  dpi.

This helps to avoid needing to do a fixup in the
https://github.com/wez/wezterm/issues/4966 case, and may help with
the various other macos quirky issues.

refs: https://github.com/wez/wezterm/issues/2958
refs: https://github.com/wez/wezterm/issues/3575
refs: https://github.com/wez/wezterm/issues/3900
refs: https://github.com/wez/wezterm/issues/4250
refs: https://github.com/wez/wezterm/issues/4285
refs: https://github.com/wez/wezterm/issues/4447
refs: https://github.com/wez/wezterm/issues/4851
refs: https://github.com/wez/wezterm/issues/4966
2024-02-06 22:57:05 -07:00
Wez Furlong 99c17b166f add wezterm start --new-tab and wezterm connect --new-tab
refs: https://github.com/wez/wezterm/discussions/4854
refs: https://github.com/wez/wezterm/discussions/4946
2024-02-03 07:51:06 -07:00
Quan Tong 8f845f9b47 simplify 2023-08-28 21:58:22 -07:00
Quan Tong cb2178e7d7 add zoom-pane subcommand 2023-08-28 21:58:22 -07:00
Wez Furlong f21dcb965e wezterm cli tlscreds: add --pem output mode
refs: #3892
2023-06-22 21:21:34 -07:00
Mat JonesandWez Furlong 2f4266cb6a feat: resize pane from CLI (#3491)
* WIP resize pane from CLI

* fix response types

* fix: remove unneeded `import std::usize;`

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* fix: update derived files

* fix: update codec version

* chore: update changelog.md

* fix: remove unneeded `import std::usize;`

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* chore: update changelog.md

* remove erroneous changelog.md change

* remove erroneous changelog.md change

* remove whitespace changes

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2023-04-18 08:34:39 -07:00
Wez Furlong 0ca050e09d expose the tty name associated with a pane 2023-04-06 17:13:07 -07:00
Wez Furlong 96f1585b10 wezterm cli list: add is_active and is_zoomed fields to json output
is_active is true if the pane is considered to be the active pane
within its containing tab.

If you want to reason about the focused pane regardless of tab,
`wezterm cli list-clients` has that pane_id.

refs: https://github.com/wez/wezterm/issues/3413
2023-04-05 07:30:38 -07:00
Wez Furlong 9b67a71485 add wezterm cli get-pane-direction
refs: https://github.com/mrjones2014/smart-splits.nvim/issues/53
2023-04-05 07:00:49 -07:00
Wez Furlong 9d44d6d864 cli: add --pane-id option to activate-pane-direction
This matches the other subcommands that use this
2023-04-04 17:18:14 -07:00
Wez Furlong 084e656996 cli: defer parsing config in most cases
refs: https://github.com/mrjones2014/smart-splits.nvim/discussions/52
refs: #3402
2023-04-04 14:43:16 -07:00
Wez Furlong 5be7f93317 refactor: split cli subcommand into separate modules 2023-04-02 09:21:33 -07:00