Files
Andrew Kofink 6d021f7bef
Some checks failed
CI / lint (push) Failing after 1m4s
CI / interface (push) Has been skipped
CI / unit (push) Has been skipped
CI / ruby-compatibility (3.3.11) (push) Has been skipped
CI / ruby-compatibility (3.4.9) (push) Has been skipped
CI / ruby-compatibility (4.0.5) (push) Has been skipped
fix: avoid bash-only [[ in current_session_name (#1003)
* fix: avoid bash-only [[ in current_session_name

Metadata

Fixes #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.

* test: restore TMUX env by key presence in util specs

Metadata

Follow-up to #1003 / #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.
2026-07-10 11:17:10 -04:00
..