diff --git a/src/ui/app.rs b/src/ui/app.rs index 7ede071a..fe297981 100644 --- a/src/ui/app.rs +++ b/src/ui/app.rs @@ -5456,9 +5456,12 @@ impl Tty7App { self.activate(index, window, cx); } + // The directory the source runs in, on whichever host it runs on: an + // agent keys its history by directory, and a fork started anywhere + // else finds nothing to branch. let (cwd, shell) = { let view = source.read(cx); - (view.local_cwd(), view.shell_spec()) + (view.spawnable_cwd(), view.shell_spec()) }; let group = self.spawn_group(cwd.as_deref(), cx); let new = match new_terminal( @@ -5484,12 +5487,9 @@ impl Tty7App { return; } }; - let Some(terminal) = new.terminal() else { - log::error!("fork spawn produced a pane that is still connecting"); - window.push_notification(t(L10nKey::AppForkStillConnecting), cx); - return; - }; - terminal.read(cx).run_command_line(&cmd); + // A remote workspace's pane is still dialling here; the fork runs + // the moment it lands. + crate::ui::agent_launch::run_when_ready(&new, cmd, cx); match placement { ForkPlacement::NewTab => { diff --git a/src/ui/i18n/en.rs b/src/ui/i18n/en.rs index f88c2e9a..f8e29df7 100644 --- a/src/ui/i18n/en.rs +++ b/src/ui/i18n/en.rs @@ -1901,10 +1901,11 @@ pub fn translate_en(key: L10nKey) -> &'static str { L10nKey::AppWorktreeRemovedBranchKept => { "Removed worktree; kept branch \"{branch}\", which has unmerged commits" } - L10nKey::AppForkStillConnecting => "Could not fork: the pane is still connecting", L10nKey::AppPaneNoCodingAgent => "This pane isn't running a coding agent", L10nKey::AppForkNoCommand => "tty7 has no fork command for {name}", - L10nKey::AppForkLocalOnly => "{name} sessions can only be forked from a local pane", + L10nKey::AppForkLocalOnly => { + "{name} sessions can't be forked from inside an SSH or WSL session" + } L10nKey::AppForkNoSessionId => { "tty7 hasn't seen a {name} session id in this pane — install its hooks in Settings → Integrations" } diff --git a/src/ui/i18n/ja.rs b/src/ui/i18n/ja.rs index 650fc3a5..81da14e4 100644 --- a/src/ui/i18n/ja.rs +++ b/src/ui/i18n/ja.rs @@ -1946,11 +1946,10 @@ pub fn translate_ja(key: L10nKey) -> Option<&'static str> { L10nKey::AppWorktreeRemovedBranchKept => { "ワークツリーを削除しました。ブランチ「{branch}」には未マージのコミットがあるため残しました" } - L10nKey::AppForkStillConnecting => "フォークできませんでした: ペインはまだ接続中です", L10nKey::AppPaneNoCodingAgent => "このペインはコーディングエージェントを実行していません", L10nKey::AppForkNoCommand => "tty7 には {name} 用のフォークコマンドがありません", L10nKey::AppForkLocalOnly => { - "{name} のセッションはローカルペインからしかフォークできません" + "SSH または WSL セッション内の {name} のセッションはフォークできません" } L10nKey::AppForkNoSessionId => { "tty7 はこのペインで {name} のセッション ID を確認できていません — 設定 → 連携でフックをインストールしてください" diff --git a/src/ui/i18n/mod.rs b/src/ui/i18n/mod.rs index 3b5f1460..9d044c97 100644 --- a/src/ui/i18n/mod.rs +++ b/src/ui/i18n/mod.rs @@ -1601,7 +1601,6 @@ l10n_keys! { AppWorktreeSetupSkip, AppWorktreeNotCarried, AppWorktreeRemovedBranchKept, - AppForkStillConnecting, AppPaneNoCodingAgent, AppForkNoCommand, AppForkLocalOnly, diff --git a/src/ui/i18n/zh.rs b/src/ui/i18n/zh.rs index 22d3aeab..a705729a 100644 --- a/src/ui/i18n/zh.rs +++ b/src/ui/i18n/zh.rs @@ -1768,10 +1768,9 @@ pub fn translate_zh(key: L10nKey) -> Option<&'static str> { L10nKey::AppWorktreeRemovedBranchKept => { "已删除 worktree;分支“{branch}”有未合并的提交,已保留" } - L10nKey::AppForkStillConnecting => "无法 fork:窗格仍在连接中", L10nKey::AppPaneNoCodingAgent => "此窗格未运行编码 agent", L10nKey::AppForkNoCommand => "tty7 没有用于 {name} 的 fork 命令", - L10nKey::AppForkLocalOnly => "{name} 会话只能从本地窗格 fork", + L10nKey::AppForkLocalOnly => "无法在 SSH 或 WSL 会话里 fork {name} 会话", L10nKey::AppForkNoSessionId => { "tty7 尚未在此窗格中看到 {name} 的会话 ID,请在“设置 → 集成”中安装其 hook" }