Skip to content

Environment variables in tmux options not honoured #1

Open
@eulersson

Description

@eulersson

Environment

  • OS: macOS 14.4.1
  • Terminal: iTerm Build 3.5.0beta22
  • Shell: zsh 5.9 (x86_64-apple-darwin23.0) bash 3.2.57(1)-release
  • tmux: 3.4

Problem

If I follow the instructions and set the @dark-notify-theme-path-light or dark equivalent as follows:

set -g @dark-notify-theme-path-light '$HOME/.config/tmux/plugins/tmux-colors-solarized/tmuxcolors-light.conf'
                                      ^^^^^

It won't work and won't be able to resolve the file because the $HOME variable won't be expanded:

The theme_path=$(eval echo "$theme_path") resolves to /$HOME/.config/... instead of /Users/ramon/.config/...:

theme_path=$(eval echo "$theme_path")

If I add some prints to your script and change the macOS's Dark/Light system preference:

Screenshot 2024-05-05 at 10 57 39

Suggested Solution

If instead of using single quotes...

set -g @dark-notify-theme-path-light '$HOME/.config/tmux/plugins/tmux-colors-solarized/tmuxcolors-light.conf'

... I use double quotes...

set -g @dark-notify-theme-path-light "$HOME/.config/tmux/plugins/tmux-colors-solarized/tmuxcolors-light.conf"

... Then this issue does not happen anymore.

I suggest making explicit in the README about this issue (at least happening on macOS) or handling the case in the tmux-theme-mode.sh script of this project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions