mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-21 16:02:20 +00:00
fix(terminal): keep the \\wsl$ completion route on this machine's panes
A WSL pane owned by a remote host reaches its distro through that host, not through a local \\wsl$ share -- a same-named local distro would list the wrong machine's files. Gate wsl_share_cwd on host locality, so a remote host's WSL pane falls back to handing Tab to the shell.
This commit is contained in:
@@ -3642,7 +3642,14 @@ impl TerminalView {
|
||||
/// filesystem is a WSL distro's: the local wsl.exe pane (tagged by its
|
||||
/// remote context) and the WSL-workspace pane (tagged by its workspace
|
||||
/// target) both report a POSIX cwd this process cannot read natively.
|
||||
///
|
||||
/// Only for panes on this machine: a WSL pane owned by a remote host
|
||||
/// reaches its distro through that host, not through a `\\wsl$` share
|
||||
/// here — a same-named local distro would list the wrong machine.
|
||||
fn wsl_share_cwd(&self) -> Option<std::path::PathBuf> {
|
||||
if !self.host_id.is_local() {
|
||||
return None;
|
||||
}
|
||||
let distro = match self.terminal.remote_context() {
|
||||
Some(remote) => (remote.kind == crate::daemon::protocol::RemoteKind::Wsl)
|
||||
.then_some(remote.target)?,
|
||||
|
||||
Reference in New Issue
Block a user