Make tmux alert parsing and focus more robust
Session names can contain pipes but never colons, so split fields on colons instead. Remember refreshes that arrive while the indicator is already polling, and jump to the most recently used tmux client rather than an arbitrary one. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
a382be2645
commit
5b130c1063
@@ -8,6 +8,7 @@ BarIndicator {
|
||||
|
||||
property int waitingCount: 0
|
||||
property string tooltip: ""
|
||||
property bool refreshPending: false
|
||||
|
||||
active: waitingCount > 0
|
||||
activeText: ""
|
||||
@@ -16,7 +17,8 @@ BarIndicator {
|
||||
inactiveTooltipText: "No terminal is waiting"
|
||||
|
||||
function refresh() {
|
||||
if (!statusProc.running) statusProc.running = true
|
||||
if (statusProc.running) refreshPending = true
|
||||
else statusProc.running = true
|
||||
}
|
||||
|
||||
function update(raw) {
|
||||
@@ -54,6 +56,11 @@ BarIndicator {
|
||||
root.waitingCount = 0
|
||||
root.tooltip = ""
|
||||
}
|
||||
|
||||
if (root.refreshPending) {
|
||||
root.refreshPending = false
|
||||
root.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user