| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Metadata Fixes tmuxinator#978 Problem `stop_all` shells out through `Util#current_session_name`, which uses bash-only `[[ ... ]]` inside Ruby backticks. On systems where `/bin/sh` is dash (Debian, Ubuntu, Linux Mint), each stop prints `sh: 1: [[: not found`. Solution Check `ENV.key?("TMUX")` in Ruby before running `tmux display-message`, add unit coverage for both branches, and document the fix in the unreleased changelog.
There was a problem hiding this comment.
Fixes tmuxinator stop_all emitting sh: 1: [[: not found on systems where /bin/sh is dash, by removing a bash-only [[ ... ]] conditional from Util#current_session_name and handling the “not in tmux” case in Ruby.
Changes:
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/tmuxinator/util.rb | Replaces bash-only conditional with a Ruby ENV.key?("TMUX") guard before shelling out to tmux. |
| spec/lib/tmuxinator/util_spec.rb | Adds specs for current_session_name behavior when TMUX is present/absent. |
| CHANGELOG.md | Documents the POSIX /bin/sh compatibility fix for stop_all. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Metadata Follow-up to tmuxinator#1003 / tmuxinator#978 Problem ENV restoration used truthiness of the original value, so an empty-string TMUX would not be restored correctly across examples. Solution Track whether TMUX was originally present with ENV.key? and restore or delete accordingly via a small with_env helper.
| Back | FazBrowse Home | New Git URL |
Metadata
Fixes #978
Problem / Motivation
tmuxinator stop_all prints sh: 1: [[: not found for each stopped session when /bin/sh is dash (Debian, Ubuntu, Linux Mint).
Util#current_session_name shells out with bash-only [[ ... ]], and Ruby backticks run under /bin/sh.
Solution
Resolve the current session name in Ruby via ENV.key?("TMUX") before calling tmux display-message, so no shell conditional is required.
Testing
Added unit coverage for #current_session_name with and without TMUX set.
Reproduced the original dash error with: