219 Commits
Author SHA1 Message Date
Mateusz Mikuła 1026152aa1 test,ssh: avoid leaking user config into testing ssh sessions (#8395) 2026-11-27 09:10:11 +01:00
Wez Furlong 9b919222ca wezterm-ssh: Skip e2e tests when sshd fixture cannot run properly
This uses the system ssh client to validate the sshd fixture. Real client
regressions will still fail the test rather than being skipped.
2026-10-10 08:39:11 +01:00
HuaGu-Dragon fff02ca501 perf: Simplify string case conversions to ASCII only (#7890) 2026-07-07 09:37:16 +02:00
Wez Furlong 75df5e24d9 cargo fix 2025-10-05 10:58:00 +01:00
Wez Furlong f150ade689 wezterm-ssh: fixup test for varying local hostname in CI 2025-05-24 07:46:29 -07:00
Wez Furlong aef3827cd7 wezterm-ssh: fixup standalone build 2025-05-24 07:38:57 -07:00
Wez Furlong 662e9b0c7b wezterm-ssh: expand a couple more ssh_config tokens
A couple of these are for things that we don't support; the intent
is not to support the associated features so much as avoid emitting
warnings when loading an ssh config that references them, especially if
the offending section of the config isn't actually being used by
wezterm.

refs: https://github.com/wezterm/wezterm/issues/6975
2025-05-24 07:25:44 -07:00
Wez Furlong 8e35f94d7c wezterm-ssh: fix leaking ssh-agent children in tests
This has been bothering me for a long time; ensure that we kill
the ssh-agent processes spawned by the tests.
2025-05-17 09:21:11 -07:00
Wez Furlong 909573fad9 ssh: implement ServerAliveInterval for libssh backend
This is a partial implementation of keepalives; it has the good
part (the sending of the packet on the requested interval), but
not the other part (disconnecting if we don't hear anything after
some number of packets).

The reason for not having the latter is that it isn't obvious to me how
to expose whether the channel had more incoming packets since sending
the ignore, so we cannot confidently act to terminate the connection.

refs: https://github.com/wezterm/wezterm/issues/4023
2025-05-14 07:14:22 -07:00
Wez Furlong 0f342e8894 wezterm-ssh: fixup standalone std build 2025-05-10 15:31:49 -07:00
Wez Furlong 3b994de290 deps: remove once_cell in favor of std functionality 2025-02-12 10:00:31 -07:00
Wez Furlong edcdefda3b workspace-ify the deps
There have been a couple of attempts at this in the past, which
had some usability warts in what I recall as an earlier, less
useful set of features overall.

Whether that was collective misunderstanding at the time, or things
have gotten better since then, now is a good time to adopt the workspace
dep syntax, because wezterm has many crates to keep on top of, and
automation like dependabot can't see a lot of them.

This will help to manage the versions of deps in wezterm centrally.

Let's try this out in CI: the Cargo.lock changes here are minimal
(eliminated a second version of base64 from one crate, terminal_size
from another, and removed an explicit dep on serde_derive) so
hopefully this sails through on !linux.

closes: https://github.com/wezterm/wezterm/pull/6668
2025-02-12 09:43:36 -07:00
Wez Furlong 4d3911b5e2 termwiz: prep for making a new release 2025-02-10 08:45:17 -07:00
Wez Furlong a95a584344 bump libssh-rs again 2025-02-09 13:49:11 -07:00
Wez Furlong 9270da12c5 update libssh to 0.11.1
refs: https://github.com/wezterm/wezterm/pull/6156
2025-02-09 12:53:31 -07:00
Wez Furlong 8953b211e8 wezterm-ssh: self-skip tests if sshd not installed 2025-02-08 12:52:12 -07:00
Wez Furlong 11c4b11669 s,wez/wezterm,wezterm/wezterm,
I moved the repo to an org of its own. Update various things
to reference the new location.
2025-02-07 13:08:01 -07:00
Martin von Zweigbergk 4bf0007cef add a few missing license files
I didn't symlink to the license file in the root because it mentions
license that don't seem to apply to the crates I added license files
to here.

I used the year each directory was created as the first copyright
year.

I didn't add license files to all crates because I don't need them for
what I'm working on right now, and I want to avoid having to figure
out which licenses apply to which crates.

#2347
2025-01-24 15:40:57 -07:00
Wez Furlong 6f375e29a2 wezterm-ssh: update pty version 2024-12-05 08:35:33 -07:00
Sean Estabrooks c3fd4b068c Address some lint warnings from Clippy 2024-09-14 09:18:24 -07:00
Sean Estabrooks 1e4dcf0244 Don't pass ProxyCommand, just look it up
It doesn't make much sense to pass this value, especially
after adding the ProxyUseFDpass functionality, which
accesses the config directly anyway.
2024-09-14 09:18:24 -07:00
Sean Estabrooks caf450b873 Implement ProxyUseFDpass for ssh
This allows the ProxyUseFDpass ssh config option, to be
used on Linux and Mac OS.  This was requested in
enhancement issue #6093
2024-09-14 09:18:24 -07:00
Naitik Shah 463df9ebed kill and reap ProxyCommand
The wrapper struct ensures ensures the child process spawned for
the ProxyCommand is cleaned up under all the various error scenarios
(such as auth failures etc), as well as in the normal successful use
case. This includes killing it if necessary, and then waiting for it.
2024-07-15 06:14:04 -07:00
Wez Furlong 5b0642d2dc fix unused mut warning 2024-07-14 07:45:54 -07:00
dependabot[bot] b158472099 build(deps): bump the all group across 1 directory with 2 updates
Bumps the all group with 2 updates in the / directory: [http_req](https://github.com/jayjamesjay/http_req) and [gethostname](https://github.com/swsnr/gethostname.rs).


Updates `http_req` from 0.10.3 to 0.11.0
- [Release notes](https://github.com/jayjamesjay/http_req/releases)
- [Commits](https://github.com/jayjamesjay/http_req/compare/v0.10.3...v0.11.0)

Updates `gethostname` from 0.4.3 to 0.5.0
- [Changelog](https://github.com/swsnr/gethostname.rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/swsnr/gethostname.rs/compare/v0.4.3...v0.5.0)

---
updated-dependencies:
- dependency-name: http_req
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: gethostname
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-13 06:49:29 -07:00
Wez Furlong 44c1335856 wezterm-ssh: avoid configuration default config files in tests 2024-07-13 06:39:11 -07:00
Wez Furlong accd16e72e deps: update rstest
closes: https://github.com/wez/wezterm/pull/5512
2024-06-07 17:53:46 -07:00
Wez Furlong 0fcd4a847c move uds stuff into new wezterm-uds crate
This centralizes the conditional imports and makes a home
for the IoSafe trait annotation for smol/async-io compat.
2024-05-13 17:56:57 -07:00
Wez Furlong 6ad0da98d8 deps: remove smol-potat, update futures-lite
smol-potat hasn't had updates in 4 years and was bifurcating some
big deps.  It wasn't necessary; it was trivially easy to replace
with smol::block_on with no meaningful increase in boilerplate,
and the result is much more understandable in purpose and effect.
2024-05-13 11:43:10 -07:00
Wez Furlong 944e0b29b6 deps: update to new filenamegen 2024-05-13 11:19:33 -07:00
Wez Furlong 1ca5e6cc90 deps: upgrade smol to 2.0 2024-05-13 10:26:29 -07:00
Wez Furlong f0e62d26f3 update libssh-rs 2024-05-13 07:19:17 -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
Riatre 9b811c7a16 Wire up agent forward for libssh backend (#5345)
* Wire up agent forward for libssh backend

TSIA.

There's a drive-by change in sftpwrap.rs for bumping to new libssh-rs.
2024-05-08 08:09:07 -07:00
dependabot[bot] 8fa4ba9ace build(deps): bump base64 in the all group across 1 directory
Bumps the all group with 1 update in the / directory: [base64](https://github.com/marshallpierce/rust-base64).


Updates `base64` from 0.21.7 to 0.22.1
- [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md)
- [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.21.7...v0.22.1)

---
updated-dependencies:
- dependency-name: base64
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-05 17:59:15 -07:00
emc2314 c2fb3cb760 Fix SSH config %h using Host (#5163)
* Fix SSH config %h using Host

* Fix test and use workaround for 2nd pass parsing

* Better implementation from @wheatdog
2024-05-05 13:43:52 -07:00
Wez Furlong 2eac806d8c deps: rstest to 0.19 2024-05-04 17:12:55 -07:00
dependabot[bot] 15e0e61fe1 Bump whoami from 1.4.1 to 1.5.0
Bumps [whoami](https://github.com/ardaku/whoami) from 1.4.1 to 1.5.0.
- [Changelog](https://github.com/ardaku/whoami/blob/v1/CHANGELOG.md)
- [Commits](https://github.com/ardaku/whoami/compare/v1.4.1...v1.5.0)

---
updated-dependencies:
- dependency-name: whoami
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-05 08:52:35 -07:00
Wez Furlong ba85958a61 deps: update env-logger
Note that we are pinned on 0.10 for env-bootstrap, where we use it
only for its module filter parser.
2024-01-20 16:01:10 -07:00
dependabot[bot] 68d9cfc6ad build(deps): bump the all group with 6 updates
Bumps the all group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [k9](https://github.com/aaronabramov/k9) | `0.11.6` | `0.12.0` |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.78` | `1.0.79` |
| [serde](https://github.com/serde-rs/serde) | `1.0.193` | `1.0.194` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.109` | `1.0.110` |
| [clap_complete](https://github.com/clap-rs/clap) | `4.4.5` | `4.4.6` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.53` | `1.0.56` |


Updates `k9` from 0.11.6 to 0.12.0
- [Commits](https://github.com/aaronabramov/k9/commits)

Updates `anyhow` from 1.0.78 to 1.0.79
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.78...1.0.79)

Updates `serde` from 1.0.193 to 1.0.194
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.193...v1.0.194)

Updates `serde_json` from 1.0.109 to 1.0.110
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.109...v1.0.110)

Updates `clap_complete` from 4.4.5 to 4.4.6
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.4.5...clap_complete-v4.4.6)

Updates `thiserror` from 1.0.53 to 1.0.56
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.53...1.0.56)

---
updated-dependencies:
- dependency-name: k9
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-03 10:29:24 -07:00
Wez Furlong 914f18b19c remove openssl pinning, cargo update
refs: https://github.com/sfackler/rust-openssl/issues/1645
2023-09-04 13:31:03 -07:00
cycleke 211bce5037 ssh: apply HostKeyAlgorithms in ssh config 2023-08-06 10:40:44 -07:00
Wez Furlong b98923174c bump some deps, and cargo update 2023-07-09 18:26:46 -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 f4b82c583c fix libssh booboo 2023-05-29 21:18:02 -07:00
Chip Senkbeil f88f1aa58a Fix sftp::FilePermissions::is_readonly to properly report readonly status 2023-05-27 09:46:36 -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 0ca050e09d expose the tty name associated with a pane 2023-04-06 17:13:07 -07:00
Wez Furlong c3472cc969 ssh: fix token expansion for ProxyCommand
refs: https://github.com/wez/wezterm/issues/3437
2023-04-03 17:04:53 -07:00
Wez Furlong d6e8271b5b update libssh-rs dep to latest build
Don't need to point to the git repo for this any more, just
use the published release.
2023-03-30 06:39:56 -07:00