mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 13:21:38 +03:00
wezterm-ssh: fix parsing of proxycommand
refs: https://github.com/wez/wezterm/issues/3307
This commit is contained in:
parent
b4f4264b00
commit
c781be3124
@ -17,7 +17,8 @@ usually the best available version.
|
|||||||
|
|
||||||
As features stabilize some brief notes about them will accumulate here.
|
As features stabilize some brief notes about them will accumulate here.
|
||||||
|
|
||||||
#### Not Yet
|
#### Fixed
|
||||||
|
* ssh ProxyCommand didn't parse command lines containing `=` correctly. #3307
|
||||||
|
|
||||||
### 20230320-124340-559cb7b0
|
### 20230320-124340-559cb7b0
|
||||||
|
|
||||||
|
@ -239,8 +239,7 @@ impl ParsedConfigFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(sep) = line
|
if let Some(sep) = line
|
||||||
.find('=')
|
.find(|c: char| c == '=' || c.is_whitespace())
|
||||||
.or_else(|| line.find(|c: char| c.is_whitespace()))
|
|
||||||
{
|
{
|
||||||
let (k, v) = line.split_at(sep);
|
let (k, v) = line.split_at(sep);
|
||||||
let k = k.trim().to_lowercase();
|
let k = k.trim().to_lowercase();
|
||||||
@ -739,6 +738,54 @@ mod test {
|
|||||||
use super::*;
|
use super::*;
|
||||||
use k9::snapshot;
|
use k9::snapshot;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn parse_proxy_command() {
|
||||||
|
let mut config = Config::new();
|
||||||
|
config.add_config_string(
|
||||||
|
r#"
|
||||||
|
Host foo
|
||||||
|
ProxyCommand /usr/bin/ssh-proxy-helper -oX=Y host 22
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
|
||||||
|
snapshot!(
|
||||||
|
&config,
|
||||||
|
r#"
|
||||||
|
Config {
|
||||||
|
config_files: [
|
||||||
|
ParsedConfigFile {
|
||||||
|
options: {},
|
||||||
|
groups: [
|
||||||
|
MatchGroup {
|
||||||
|
criteria: [
|
||||||
|
Host(
|
||||||
|
[
|
||||||
|
Pattern {
|
||||||
|
negated: false,
|
||||||
|
pattern: "^foo$",
|
||||||
|
original: "foo",
|
||||||
|
is_literal: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
context: FirstPass,
|
||||||
|
options: {
|
||||||
|
"proxycommand": "/usr/bin/ssh-proxy-helper -oX=Y host 22",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
loaded_files: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
options: {},
|
||||||
|
tokens: {},
|
||||||
|
environment: None,
|
||||||
|
}
|
||||||
|
"#
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_user() {
|
fn parse_user() {
|
||||||
let mut config = Config::new();
|
let mut config = Config::new();
|
||||||
|
Loading…
Reference in New Issue
Block a user