Fix pause toggle: never delete the flag file

The FileView watcher fires on content changes but not on deletion, so
resuming (rm of the flag) left the panel and the menu stuck paused.
Rewrite the flag with 0 or 1 instead, matching the state-file pattern
that already works.
This commit is contained in:
felixzsh
2026-08-11 14:03:12 -05:00
parent f255fa05e9
commit 34646dec28
3 changed files with 8 additions and 3 deletions
+4 -1
View File
@@ -41,9 +41,12 @@ Panel {
function setPaused(p) {
if (p === root.paused) return
// The flag file is always rewritten with "0" or "1" — never deleted:
// the FileView watcher fires on content changes but not on deletion, so
// a removed flag would leave the toggle stuck.
var cmd = p
? "printf 1 > " + Util.shellQuote(root.pausePath)
: "rm -f " + Util.shellQuote(root.pausePath)
: "printf 0 > " + Util.shellQuote(root.pausePath)
toggleProc.command = ["sh", "-c", cmd]
toggleProc.running = true
}