Skip to content

tmux: simplify status interpolation - #11

Merged
barlevalon merged 1 commit into
mainfrom
review-interpolation
Aug 22, 2026
Merged

tmux: simplify status interpolation#11
barlevalon merged 1 commit into
mainfrom
review-interpolation

Conversation

@barlevalon

Copy link
Copy Markdown
Owner

Summary

  • install the now-playing command through one shared path for global status-left and status-right
  • replace every exact literal #{nowplaying} placeholder while preserving surrounding status text and unrelated #(...) commands
  • quote the generated script path so installations beneath directories containing spaces remain one shell word

Placeholder semantics and idempotency

A status option is written only when its current value contains the exact literal #{nowplaying}. All exact occurrences on that side are replaced in one write. Near matches and unrelated nowplaying.sh text do not trigger or suppress replacement.

After installation, the exact placeholder no longer remains. Reloading the plugin therefore performs no status write; no installed-command guard is needed.

Tests

  • stateful tmux mock coverage for both status sides and write counts
  • multiple placeholders on one side
  • reload idempotency
  • mixed unrelated command plus placeholder
  • installation paths containing spaces
  • no-placeholder and near-match no-op behavior
  • bash -n nowplaying.tmux scripts/*.sh
  • ./scripts/test.sh
  • shellcheck nowplaying.tmux scripts/*.sh
  • isolated real tmux interpolation and reload check from a path containing spaces

Residual risks

Paths containing literal double quotes, dollar signs, backticks, or backslashes are not covered by the path-with-spaces quoting test and may require a dedicated shell-quoting strategy if those installation paths need support.

@barlevalon
barlevalon force-pushed the review-interpolation branch from 4a73c6e to cfc4a3d Compare August 22, 2026 15:51
@barlevalon
barlevalon merged commit aa1ac0b into main Aug 22, 2026
2 checks passed
@barlevalon
barlevalon deleted the review-interpolation branch August 22, 2026 15:52
@barlevalon
barlevalon restored the review-interpolation branch August 22, 2026 15:59
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.

1 participant