diff options
| author | akbash <akbash@herdr.dev> | 2026-08-01 23:04:03 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-01 23:04:03 +0300 |
| commit | bd287b0158a4c11ff3844c2cf596b8bcb304a8ad (patch) | |
| tree | 4ddea7fe809c78c2dd0577cfa0b1e0bbcf933d75 | |
| parent | df2cb2c3a585bdb22bb670f6da8147c7c1ffe982 (diff) | |
fix: route vscode remote copies through osc52 (#2173)
refs #2015
Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
| -rw-r--r-- | docs/next/CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/selection.rs | 20 |
2 files changed, 18 insertions, 3 deletions
diff --git a/docs/next/CHANGELOG.md b/docs/next/CHANGELOG.md index 545ee411..72414417 100644 --- a/docs/next/CHANGELOG.md +++ b/docs/next/CHANGELOG.md @@ -12,6 +12,7 @@ - Relicensed Herdr from AGPL-3.0-or-later to Apache-2.0. ### Fixed +- Pane text copied through VS Code Remote Tunnels now reaches the viewing machine's clipboard instead of overwriting the remote host clipboard. (#2015) - Windows agent detection now follows Git Bash-launched agents across emulated `exec` process boundaries. (#2107) - Detached Windows servers and pane processes now survive logout from the OpenSSH session that started them. (#2008) - Windows `agent start` now launches agents without native arguments instead of timing out on an invalid empty PowerShell argument list. (#2072) diff --git a/src/selection.rs b/src/selection.rs index d9378571..08af95f5 100644 --- a/src/selection.rs +++ b/src/selection.rs @@ -304,15 +304,17 @@ fn is_wsl() -> bool { fn should_prefer_osc52_for_env( ssh_connection: Option<&OsStr>, ssh_tty: Option<&OsStr>, + vscode_ipc_hook_cli: Option<&OsStr>, wsl: bool, ) -> bool { - ssh_connection.is_some() || ssh_tty.is_some() || wsl + ssh_connection.is_some() || ssh_tty.is_some() || vscode_ipc_hook_cli.is_some() || wsl } fn should_prefer_osc52() -> bool { should_prefer_osc52_for_env( std::env::var_os("SSH_CONNECTION").as_deref(), std::env::var_os("SSH_TTY").as_deref(), + std::env::var_os("VSCODE_IPC_HOOK_CLI").as_deref(), is_wsl(), ) } @@ -355,19 +357,31 @@ mod tests { assert!(should_prefer_osc52_for_env( Some(OsStr::new("1 2 3 4")), None, + None, false )); assert!(should_prefer_osc52_for_env( None, Some(OsStr::new("/dev/ttys001")), + None, false )); - assert!(!should_prefer_osc52_for_env(None, None, false)); + assert!(!should_prefer_osc52_for_env(None, None, None, false)); } #[test] fn wsl_sessions_prefer_osc52() { - assert!(should_prefer_osc52_for_env(None, None, true)); + assert!(should_prefer_osc52_for_env(None, None, None, true)); + } + + #[test] + fn vscode_remote_sessions_prefer_osc52() { + assert!(should_prefer_osc52_for_env( + None, + None, + Some(OsStr::new("/tmp/vscode-remote-cli.sock")), + false + )); } #[test] |
