diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-08 23:08:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-09 00:08:42 +0300 |
| commit | 8996fc54fe4596368a1677821b1a390a70c56ab0 (patch) | |
| tree | 65ff0293a3ee17b4acc50539bff382388abaf927 /src/platform/mod.rs | |
| parent | 68c7b78ec237034cbb0e21c8666842ed7991641d (diff) | |
fix: support preinstalled windows remote hosts (#3661)
* fix: support windows hosts in saved ssh machines
refs #3651
* fix: keep windows ssh bridge writes blocking
refs #3651
* fix: close saved windows ssh bootstrap input
refs #3651
* refactor: simplify remote bridge helpers
refs #3651
* refactor: isolate remote bridge platform behavior
refs #3651
* fix: close captured ssh input under windows consoles
refs #3651
* test: remove redundant remote command assertions
refs #3651
refs #3701
* test: handle framed ssh commands in machine setup
refs #3651
---------
Co-authored-by: Ogulcan Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src/platform/mod.rs')
| -rw-r--r-- | src/platform/mod.rs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/platform/mod.rs b/src/platform/mod.rs index 335293e8..67e474ff 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -264,7 +264,9 @@ pub(crate) struct RemoteSshConfigPaths { #[cfg(unix)] mod unix_common; #[cfg(unix)] -pub(crate) use unix_common::{begin_cli_output, end_cli_output, RemoteBridgeWake}; +pub(crate) use unix_common::{ + begin_cli_output, end_cli_output, forward_remote_bridge_stdio, RemoteBridgeWake, +}; mod client_state; pub(crate) use client_state::{create_private_state_file, replace_file, sync_parent_directory}; @@ -359,6 +361,35 @@ pub(crate) fn quote_powershell_arg(value: &str) -> String { format!("'{}'", value.replace('\'', "''")) } +pub(crate) fn quote_windows_command_line_arg(value: &str) -> String { + if !value.is_empty() + && !value + .chars() + .any(|ch| matches!(ch, ' ' | '\t' | '\n' | '\x0b' | '"')) + { + return value.to_string(); + } + + let mut quoted = String::from("\""); + let mut backslashes = 0; + for ch in value.chars() { + if ch == '\\' { + backslashes += 1; + continue; + } + if ch == '"' { + quoted.push_str(&"\\".repeat(backslashes * 2 + 1)); + } else { + quoted.push_str(&"\\".repeat(backslashes)); + } + backslashes = 0; + quoted.push(ch); + } + quoted.push_str(&"\\".repeat(backslashes * 2)); + quoted.push('"'); + quoted +} + pub(crate) fn is_pane_shell_process_name(name: &str) -> bool { let normalized = normalized_process_name(name); matches!( |
