Skip to content

Commit 21e75b8

Browse files
authored
Pass through cwd from ACP extension (#39511)
If we get a `cwd` from ACP (because e.g. `codex-acp` is driving the terminal rather than our own PTY) then use that to display the `cwd` of the terminal process. Release Notes: - N/A
1 parent 978951b commit 21e75b8

File tree

1 file changed

+4
-1
lines changed
  • crates/agent_servers/src

1 file changed

+4
-1
lines changed

crates/agent_servers/src/acp.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,9 @@ impl acp::Client for ClientDelegate {
713713
if let Some(id_str) = terminal_info.get("terminal_id").and_then(|v| v.as_str())
714714
{
715715
let terminal_id = acp::TerminalId(id_str.into());
716+
let cwd = terminal_info
717+
.get("cwd")
718+
.and_then(|v| v.as_str().map(PathBuf::from));
716719

717720
// Create a minimal display-only lower-level terminal and register it.
718721
let _ = session.thread.update(&mut self.cx.clone(), |thread, cx| {
@@ -727,7 +730,7 @@ impl acp::Client for ClientDelegate {
727730
TerminalProviderEvent::Created {
728731
terminal_id: terminal_id.clone(),
729732
label: tc.title.clone(),
730-
cwd: None,
733+
cwd,
731734
output_byte_limit: None,
732735
terminal: lower,
733736
},

0 commit comments

Comments
 (0)