I have the following status-right:
set -g status-right "#{prefix_highlight}[wifi:#[fg=brightred]#(wifi_status)#[fg=yellow]|#[fg=brightgreen]#{cpu_icon}#[fg=yellow]:#{cpu_percentage}|#{battery_icon}:#{battery_percentage}:#{battery_remain}] %a %h-%d %H:%M:%S#[default]"
and in it the custom shell-command wifi_status.
which runs a function(wifi_quality) that gets the wifi status and then displays it using spark.
This was working when I had the wifi_status
file in /usr/local/bin
but I wanted it in my version control repo for my dotfiles, so I moved it to a bin folder in my .zsh
folder and added the folder to my path using
$HOME/.zsh/bin
. I can use the command in the shell terminal (even in tmux) and it displays the correct output:
▁▃▅█
But it won't display in the tmux status bar any more.
What's going on?
It's folder in $PATH
, config was reloaded, it works in terminal, the file has been set to be executable, I don't get it, why is it now not working?
Since it was asked:
I start tmux by typing it into my terminal (tmux new
).
My OS is OSX.
I'm running xterm2.
My login shell is ZSH with Oh-My-Zsh framework.
My dotfiles are located here.
Doing the following in tmux command line (prefix)
set-environment PATH $PATH
sets the PATH
variable and it shows up when doing show-environment
.
Copy + pasting wifi_status
back to the /usr/local/bin
folder also hasn't fixed the issue (even with a restart of tmux).
Writing the full path to script doesn't help either.
I solved the problem, For some reason my custom functions file wasn't being sourced properly and as a result it couldn't execute. Moving the function into the file solved that and now it's working.
PATH
? You say that you “added the folder to my path using$HOME/.zsh/bin
, but since this isn't a standard configuration file, if it's being loaded at all, it's being loaded from a standard configuration file. Which one? I suspect that you're settingPATH
only in your interactive zsh sessions and not in tmux. You need to post enough information about your configuration files to reproduce the problem. – Gilles 'SO- stop being evil' Aug 02 '16 at 23:03