Skip to content

feat: Added responsive status redraws for pane_current_command#4968

Draft
daneofmanythings wants to merge 2 commits into
tmux:floating_panesfrom
daneofmanythings:floating_panes-current-command
Draft

feat: Added responsive status redraws for pane_current_command#4968
daneofmanythings wants to merge 2 commits into
tmux:floating_panesfrom
daneofmanythings:floating_panes-current-command

Conversation

@daneofmanythings

Copy link
Copy Markdown
Member

The issue this PR solves is delayed redraws of the status line when using the format variable pane_current_command. Before, the status wouldn't be triggered to redraw when the shell had a new command ran in it. This left the format variable feeling laggy, often displaying outdated information until manual intervention.

I have added a new stateful field to struct window_pane to store the last "seen" foreground pid running at the pane's file descriptor. A new check is make across all clients in server-client.c:server_client_loop, to determine if there is a new fg pid at each of the panes being displayed by the client. Finding one such pane will exit early and trigger a status redraw.

The added complexity is minimal, but not nothing considering currently this only affects a single format variable. I find this to be the most useful format variable for panes on the status line, so I may be biased towards this feature.
@mgrant0

@nicm

nicm commented Apr 4, 2026

Copy link
Copy Markdown
Member

Hmm not sure about this.

I think this should maybe automatic-rename which is the default way of using pane_current_command... but we already slowed that down because working out the name was so slow on some platforms.

@daneofmanythings

Copy link
Copy Markdown
Member Author

I completely missed that somehow. I have reworked things to use automatic-rename.

Tracking state is still the same. The big difference is that the fg_pid is checked in the existing pane evaluation logic. Then in names.c:check_window_names, the status redraw logic is pulled out of the conditional that checks for a window name change. Unchanged active panes have been filtered out by that point, so a status redraw is warranted on clients displaying the window.

@nicm nicm moved this from Not Started to In Review in All Issues & PRs Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: For Review

Development

Successfully merging this pull request may close these issues.

3 participants