feat: the SFTP browser opens in the shell's current directory (OSC 7)

When the remote shell reports its working directory (OSC 7: fish, or
the bash/zsh hook in the manual), opening the SFTP browser from that
terminal goes there, including when it was already open elsewhere.
Without it the browser still falls back to the exec'd 'pwd' (the login
directory) and then the SFTP home. The File menu entry now goes through
the same request as the toolbar and palette.
This commit is contained in:
Andy Dixon
2026-10-12 18:40:11 +01:00
parent 58cb531e32
commit 1fcb5fa575
3 changed files with 21 additions and 4 deletions
+7 -1
View File
@@ -614,7 +614,13 @@ impl App {
}
Request::ExportEncrypted(ids) => self.transfer.export_encrypted(ids),
Request::ImportEncrypted => self.transfer.import_encrypted(),
Request::Sftp(id) => self.sftp.toggle(&id),
Request::Sftp(id) => {
let at = match self.s.pane(&id).map(|p| &p.view) {
Some(View::Terminal(t)) => t.reported_cwd.as_ref().map(|c| c.1.clone()),
_ => None,
};
self.sftp.toggle(&id, at);
}
Request::SendToActive(text) => match self.s.focused_session() {
Some(id) if self.s.session_state(&id) == Some(SessionState::Connected) => self.send_input(&id, text.as_bytes()),
_ => self.s.error("No active connected session"),