fix(modules/anomaly/tmux): fix config handling in run scripts#629
Merged
35C4n0r merged 4 commits intocoder:mainfrom Jan 4, 2026
Merged
fix(modules/anomaly/tmux): fix config handling in run scripts#62935C4n0r merged 4 commits intocoder:mainfrom
35C4n0r merged 4 commits intocoder:mainfrom
Conversation
The previous implementation using inline variable assignment and printf
caused issues with custom tmux configs containing special characters:
1. `TMUX_CONFIG="${TMUX_CONFIG}"` - Terraform's templatefile substitutes
the multi-line config inline, causing bash to interpret tmux commands
(like `set -g`, `bind C-s`) as shell commands.
2. `printf "$TMUX_CONFIG"` - The `%` character in tmux's default
horizontal split keybind (`bind %`) is interpreted as a printf format
specifier, corrupting the output.
Changes:
- Use heredoc with `read -r -d ''` for safe variable assignment
- Use `cat <<<` instead of `printf` for output
- Add `|| true` to handle read's non-zero exit on EOF
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes custom tmux configuration handling in the tmux module by addressing two critical bugs: shell command interpretation of tmux config directives (like set -g) and format specifier issues with % characters in tmux bindings (like bind %). The fix implements heredoc for variable assignment and here-string for output.
- Replaces direct variable assignment with heredoc to prevent bash from interpreting tmux configuration as shell commands
- Changes
printftocat <<<to avoid treating%characters in tmux config as format specifiers
075b283 to
48cd75d
Compare
35C4n0r
requested changes
Jan 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix custom tmux config handling. Two bugs:
TMUX_CONFIG="${TMUX_CONFIG}"- Terraform substitutes config inline, bash interpretsset -getc as shell commandsprintf "$TMUX_CONFIG"-%inbind %treated as format specifierType of Change
Module Information
Path:
registry/anomaly/modules/tmuxNew version: 1.0.4
Breaking change: [x] No
Testing & Validation
bun test)bun fmt)Related Issues
None