diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-14 05:30:20 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-14 05:30:20 +0300 |
| commit | 226e87306deaba017d36583f51ae34e42b303aad (patch) | |
| tree | 2a1155689b75007c15d93735aedfa58db7a05edf /src/app/api | |
| parent | 17544c36ee397233e2f7b3319d86e3b517e3b5d0 (diff) | |
fix: preserve tab identity across restored sessions
Diffstat (limited to 'src/app/api')
| -rw-r--r-- | src/app/api/layouts.rs | 7 | ||||
| -rw-r--r-- | src/app/api/tabs.rs | 12 |
2 files changed, 7 insertions, 12 deletions
diff --git a/src/app/api/layouts.rs b/src/app/api/layouts.rs index e397ccf8..9c492937 100644 --- a/src/app/api/layouts.rs +++ b/src/app/api/layouts.rs @@ -151,10 +151,9 @@ impl App { let closed_tab_id = self .public_tab_id(target_ws_idx, target_tab_idx) .unwrap_or_else(|| { - format!( - "{}:{}", - self.public_workspace_id(target_ws_idx), - target_tab_idx + 1 + crate::workspace::public_tab_id_for_number( + &self.public_workspace_id(target_ws_idx), + target_tab_idx + 1, ) }); let terminal_ids = self diff --git a/src/app/api/tabs.rs b/src/app/api/tabs.rs index c88a00d1..079c2ea4 100644 --- a/src/app/api/tabs.rs +++ b/src/app/api/tabs.rs @@ -105,11 +105,7 @@ impl App { if let Some(label) = label { let workspace_id = self.state.workspaces[ws_idx].id.clone(); let tab_id = self.public_tab_id(ws_idx, tab_idx).unwrap_or_else(|| { - format!( - "{}:t{}", - workspace_id, - crate::workspace::encode_public_number(tab_idx + 1) - ) + crate::workspace::public_tab_id_for_number(&workspace_id, tab_idx + 1) }); if let Some(tab) = self .state @@ -165,9 +161,9 @@ impl App { return tab_not_found(id, ¶ms.tab_id); }; let workspace_id = self.state.workspaces[ws_idx].id.clone(); - let tab_id = self - .public_tab_id(ws_idx, tab_idx) - .unwrap_or_else(|| format!("{}:{}", workspace_id, tab_idx + 1)); + let tab_id = self.public_tab_id(ws_idx, tab_idx).unwrap_or_else(|| { + crate::workspace::public_tab_id_for_number(&workspace_id, tab_idx + 1) + }); let Some(tab) = self .state .workspaces |
