Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

hn: the status line shows the focused pane's machine and repo again

Timd1ee9ebcff11
diff --git a/tui/src/options/mod.rs b/tui/src/options/mod.rs
index 2ae0c771a..08cf72d96 100644
--- a/tui/src/options/mod.rs
+++ b/tui/src/options/mod.rs
@@ -96,11 +96,12 @@ pub fn defaults() -> &'static BTreeMap<String, String> {
// where there is room. Git context stays here; the status bar keeps the location cue.
m.insert("pane-border-format".into(), " #{pane_heading}#{?pane_where,#[align=right] #[dim]#{pane_where} #[nodim],}".into());
// Window navigation on the left; connection, quota, fleet, machine and clock on the
- // right. The quoted name is this computer's name in Harness, independent of focus.
+ // right. The machine and repo are the focused pane's (a pane with no machine: this
+ // computer's name in Harness), so they change as the focus does.
// One cell at each outer edge aligns status text with the pane surfaces.
// Two spaces separate the window list from the information on the right.
m.insert("status-left".into(), " #{?client_prefix,#[bold]›#[nobold] ,}".into());
- m.insert("status-right".into(), " #{?daemon_down,#[bold]daemon down#[nobold] ,}#{?usage_remaining,#{usage_remaining_mark} ,}#{?fleet,#{s/ / /:fleet} ,}#{?pane_watching,[watching] ,}\"#{=/21/…:local_machine}\" %H:%M ".into());
+ m.insert("status-right".into(), " #{?daemon_down,#[bold]daemon down#[nobold] ,}#{?usage_remaining,#{usage_remaining_mark} ,}#{?fleet,#{s/ / /:fleet} ,}#{?pane_watching,[watching] ,}#{?pane_machine,#{=/14/…:pane_machine},#{=/14/…:local_machine}}#{?pane_project,:#{=/18/…:pane_project},#{?pane_current_path,:#{=/18/…:#{b:pane_current_path}},}} %H:%M ".into());
// Each window's most urgent harness at a glance (the symbol its pane titles show) and its
// name in a few whole words (#{window_short_name}): a harness is named for its task.
// Keep tmux's familiar current/previous markers beside the name, then any other
diff --git a/tui/tests/e2e.sh b/tui/tests/e2e.sh
index 4e30d0b7f..a13d3d9a7 100755
--- a/tui/tests/e2e.sh
+++ b/tui/tests/e2e.sh
@@ -56,7 +56,8 @@ wait_eq() { # wait_eq <what> <expected> <command…>: until the command prints w
expect "starts in a shell, as tmux does" "Mock terminal (mock)" 5000
status_tabs() { screen | tail -n 1 | grep -q '^ 0:' && echo yes; }
wait_eq "status line starts with window tabs, without a session label" yes status_tabs
-expect "status line quotes the local machine's app name" '"mock-local"'
+status_where() { screen | tail -n 1 | grep -q 'mock-local:demo [0-9][0-9]:[0-9][0-9]' && echo yes; }
+wait_eq "status line shows the focused pane's machine and repo beside the clock" yes status_where
wait_eq "desk=off: the first session is still tmux's 0" 0 hn display -p '#{session_name}'
tmux_ send-keys -t t C-b s
expect "C-b s opens the fzf list" "Search harnesses"
diff --git a/tui/tests/pane-ui.py b/tui/tests/pane-ui.py
index 43aba6b65..827adb5be 100644
--- a/tui/tests/pane-ui.py
+++ b/tui/tests/pane-ui.py
@@ -225,14 +225,16 @@ try:
assert plain_header.startswith(title + ' '), (title, plain_header)
hn('set', '-gu', 'status-right')
default_status = hn('show', '-gv', 'status-right', strip=False)
- assert all(part not in default_status for part in ('pane_branch', 'pane_where', 'pane_machine', 'pane_current_path', 'pane_project', 'git:'))
+ # The focused pane's machine and repo, beside the clock (no branch: the pane's title has it).
+ assert all(part not in default_status for part in ('pane_branch', 'pane_where', 'git:'))
+ assert 'pane_machine' in default_status and 'pane_project' in default_status
assert value('#{host}') == socket.gethostname(), 'standard host format keeps its hostname meaning'
- assert value('#{local_machine}') == 'studio', 'status uses the local machine name configured in the app'
- machine_label = '"studio"'
- assert machine_label in value(default_status), (machine_label, value(default_status))
+ assert value('#{local_machine}') == 'studio', 'a pane with no machine shows the local machine name configured in the app'
+ where = '#{?pane_machine,#{=/14/…:pane_machine},#{=/14/…:local_machine}}#{?pane_project,:#{=/18/…:pane_project},#{?pane_current_path,:#{=/18/…:#{b:pane_current_path}},}}'
+ assert where in default_status
def local_machine_status():
line = tmux('capture-pane', '-p', '-t', 'test').splitlines()[-1]
- return re.search(re.escape(machine_label) + r' \d{2}:\d{2}$', line.rstrip()) and '[' + session + ']' not in line
+ return re.search(re.escape(value(where)) + r' \d{2}:\d{2}$', line.rstrip()) and '[' + session + ']' not in line
def aligned_status_edges():
line = tmux('capture-pane', '-p', '-t', 'test').splitlines()[-1]
return re.match(r' \d+:', line) and len(line.rstrip()) == 149
@@ -244,13 +246,13 @@ try:
for target in (third, second, first):
hn('select-pane', '-t', target)
assert value(default_left).strip() == ''
- wait(local_machine_status, 'quoted local machine stays beside the clock across local and remote panes; no machine label on the left')
+ wait(local_machine_status, "the focused pane's machine and repo beside the clock, local and remote; no machine label on the left")
if target in (first, third):
snapshot('status-local' if target == first else 'status-remote')
for window in hn('list-windows', '-F', '#{window_id}').splitlines():
hn('select-window', '-t', window)
assert value(default_left).strip() == ''
- wait(local_machine_status, 'quoted local machine stays beside the clock in every window')
+ wait(local_machine_status, "the focused pane's machine and repo beside the clock in every window")
hn('select-window', '-t', current)
hn('select-pane', '-t', first)
keys('C-b')
@@ -258,7 +260,7 @@ try:
keys('Escape')
hn('rename-session', 'work-review')
assert value(default_left).strip() == '', 'renaming a session does not add a left label'
- wait(local_machine_status, 'renaming a session does not change the quoted machine name')
+ wait(local_machine_status, 'renaming a session does not change the machine and repo')
hn('set', '-g', 'status-left', '[custom] ')
assert value(hn('show', '-gv', 'status-left')).strip() == '[custom]'
hn('set', '-gu', 'status-left')