ssh remoting: Fix wrong working directory for SSH terminals (#19672)

Before this change, we would save the working directory *on the client*
of each shell that was running in a terminal.

While it's technically right, it's wrong in all of these cases where
`working_directory` was used:

- in inline assistant
- when resolving file paths in the terminal output
- when serializing the current working dir and deserializing it on
restart

Release Notes:

- Fixed terminals opened on remote hosts failing to deserialize with an
error message after restarting Zed.
This commit is contained in:
Thorsten Ball 2024-10-24 13:52:26 +02:00 committed by GitHub
parent 4214ed927f
commit efc4d3efdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 7 deletions

View file

@ -1192,7 +1192,7 @@ impl SerializableItem for TerminalView {
return None;
}
if let Some((cwd, workspace_id)) = terminal.get_cwd().zip(self.workspace_id) {
if let Some((cwd, workspace_id)) = terminal.working_directory().zip(self.workspace_id) {
Some(cx.background_executor().spawn(async move {
TERMINAL_DB
.save_working_directory(item_id, workspace_id, cwd)