aboutsummaryrefslogtreecommitdiff
path: root/src/selection.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/selection.rs')
-rw-r--r--src/selection.rs20
1 files changed, 17 insertions, 3 deletions
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]