Skip to content

Animate window title while working for tmux activity detection#1949

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/when-running-inside-tmux-there-s-no-visi-12a66d94
Mar 6, 2026
Merged

Animate window title while working for tmux activity detection#1949
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/when-running-inside-tmux-there-s-no-visi-12a66d94

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Mar 5, 2026

When running inside tmux, the TUI's alternate screen and progress bar protocol are not visible in the tmux status bar. This makes it hard to tell whether the agent is actively working.

This PR prepends a rotating braille spinner character to the terminal window title while the agent is working. tmux detects title changes as pane activity, making the working state visible in the status bar.

Changes

  • pkg/tui/tui.go: Track animation frame in appModel and prepend a spinner character to the window title when working.
  • pkg/tui/components/spinner/spinner.go: Add exported Frame(index) accessor for the spinner characters, keeping the slice unexported to prevent external mutation.
  • pkg/tools/builtin/user_prompt.go, pkg/tui/dialog/elicitation.go, pkg/tui/dialog/elicitation_test.go: Improve user_prompt TUI dialog with title, free-form input, and keyboard navigation.

@dgageot dgageot requested a review from a team as a code owner March 5, 2026 18:43
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Assessment: 🟢 APPROVE

No bugs found in the changed code. The implementation is safe and well-structured:

  • Spinner animation: The animFrame counter is managed correctly on the main UI thread with no race conditions
  • Bounds safety: The Frame(index) function uses modulo arithmetic to prevent index out of bounds
  • User prompt improvements: Title field and free-form input handling are implemented correctly with appropriate nil checks

The changes successfully address the tmux activity detection issue by animating the window title with a rotating spinner character.

When running inside tmux, the TUI's alternate screen and progress bar
protocol are not visible in the tmux status bar. This makes it hard to
tell whether the agent is actively working.

Prepend a rotating braille spinner character to the terminal window
title while the agent is working. tmux detects title changes as pane
activity, making the working state visible in the status bar.

Also improve the user_prompt TUI dialog with title, free-form input,
and keyboard navigation.

Assisted-By: cagent
@dgageot dgageot force-pushed the board/when-running-inside-tmux-there-s-no-visi-12a66d94 branch from dce298d to 4058fa0 Compare March 6, 2026 06:40
@dgageot dgageot merged commit a3f97d5 into docker:main Mar 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants