aboutsummaryrefslogtreecommitdiff
path: root/tests/api_ping.rs
diff options
context:
space:
mode:
authorPitchfork-and-Torch <Pitchfork-and-Torch@users.noreply.github.com>2026-07-09 21:11:52 -0400
committerOgulcan Celik <ogulcancelik@gmail.com>2026-07-10 15:06:54 +0300
commit4f7fcc48d1f760ab6057d0964f009c05b753456a (patch)
treeee617c2d12d4c33c2c63a6a8048ab9e80a11d225 /tests/api_ping.rs
parentc8850a2e3e284033142db0f8117fa5998c68bd59 (diff)
fix: follow foreground cwd for new terminals
refs #1245
Diffstat (limited to 'tests/api_ping.rs')
-rw-r--r--tests/api_ping.rs57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/api_ping.rs b/tests/api_ping.rs
index 24204548..aea8188a 100644
--- a/tests/api_ping.rs
+++ b/tests/api_ping.rs
@@ -705,6 +705,10 @@ fn pane_info_reports_foreground_cwd_without_changing_pane_cwd() {
.as_str()
.unwrap()
.to_string();
+ let workspace_id = created["result"]["workspace"]["workspace_id"]
+ .as_str()
+ .unwrap()
+ .to_string();
let command = format!(
"/bin/sh -c 'cd {} && printf %s $$ > {} && touch {} && sleep 30'",
foreground.display(),
@@ -788,6 +792,59 @@ fn pane_info_reports_foreground_cwd_without_changing_pane_cwd() {
foreground.display().to_string()
);
+ let split = send_request(
+ &socket_path,
+ &serde_json::json!({
+ "id": "fg_split",
+ "method": "pane.split",
+ "params": {
+ "target_pane_id": pane_id,
+ "direction": "right",
+ "focus": false,
+ },
+ })
+ .to_string(),
+ );
+ assert_eq!(
+ split["result"]["pane"]["cwd"],
+ foreground.display().to_string()
+ );
+
+ let tab = send_request(
+ &socket_path,
+ &serde_json::json!({
+ "id": "fg_tab",
+ "method": "tab.create",
+ "params": {
+ "workspace_id": workspace_id,
+ "focus": false,
+ },
+ })
+ .to_string(),
+ );
+ assert_eq!(
+ tab["result"]["root_pane"]["cwd"],
+ foreground.display().to_string()
+ );
+
+ let explicit_tab = send_request(
+ &socket_path,
+ &serde_json::json!({
+ "id": "fg_explicit_tab",
+ "method": "tab.create",
+ "params": {
+ "workspace_id": workspace_id,
+ "cwd": base,
+ "focus": false,
+ },
+ })
+ .to_string(),
+ );
+ assert_eq!(
+ explicit_tab["result"]["root_pane"]["cwd"],
+ base.display().to_string()
+ );
+
cleanup_spawned_herdr(child, base);
}