feat: open the session in hx with --session from the TUI
build / version (push) Successful in 10s
build / build (aarch64-apple-darwin) (push) Successful in 4m30s
build / build (x86_64-unknown-linux-musl) (push) Successful in 3m44s
build / release (push) Successful in 25s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
johannesandClaude Sonnet 5.5 committed 2026-11-15 22:23:05 +01:00
1 parent 5611ad7e6a
commit a4df9c3b01
2 files changed
+11 -5

No files matched your search

+10 -4
View File
@@ -768,12 +768,18 @@ fn transcript(app: &App, id: &str) -> Pager {
}
}
/// Opens hx in the worktree: the TUI steps aside for the time hx runs.
fn open_in_hx(term: &mut ratatui::DefaultTerminal, worktree: &str) -> Option<String> {
/// Opens hx on the session's conversation in the worktree: the TUI steps aside for the time hx runs.
fn open_in_hx(
term: &mut ratatui::DefaultTerminal,
worktree: &str,
session: &str,
) -> Option<String> {
let hx = crate::profile::Profile::load("default").map_or_else(|_| "hx".into(), |p| p.hx);
let mut parts = hx.split_whitespace();
let mut cmd = std::process::Command::new(parts.next()?);
cmd.args(parts).current_dir(worktree);
cmd.args(parts)
.args(["--session", session])
.current_dir(worktree);
ratatui::restore();
let res = cmd.status();
*term = ratatui::init();
@@ -1002,7 +1008,7 @@ fn on_key(
}
KeyCode::Char('o') => {
if let Some(d) = &app.detail
&& let Some(err) = open_in_hx(term, &d.worktree.clone())
&& let Some(err) = open_in_hx(term, &d.worktree.clone(), &d.id.clone())
{
app.pager = Some(Pager {
title: "open worktree".into(),