Closed suckerSlayer closed 2 years ago
Hi! Sorry about your issue. I'll try to address it, but first I have some questions.
1) Did you do Ctrl+B
followed by I
(the letter i) to fetch and install the plugin?
2) Are you using tmux plugin manager (TPM) or manual install?
3) Are you using other tmux plugins, and do they work fine?
Unfortunately I don't have a Mac to test for myself.
Thanks for your reply! And yes, I have other plugins installed by TPM, and they basically work fine. I also have tmux-df installed this way. By the way I am using zsh instead of MacOS default bash, not sure it matters or not.
I did as much research as I could, given that I don't have a Mac myself. The only clue I found is that macOS has an old version of Bash, which probably doesn't support the type of array I used in my script. I tried replacing that array with a different one which might be more compatible with older Bash versions.
Could you try this branch and see if it fixes the problem?
I was able to switch my tmux to this branch by doing the following:
tmux kill-server
if necessary)~/.tmux/plugins/tmux-df
(default location).tmux.conf
and delete the line set -g @plugin 'tassaron/tmux-df'
set -g @plugin 'tassaron/tmux-df#without-associative-array'
prefix + I
to install the new version of the pluginIf you don't delete the plugin before changing branches, TPM will silently ignore the change of branch.
I'm also curious what the output of bash --version
is for you?
bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
Copyright (C) 2007 Free Software Foundation, Inc.
Okay, I believe associative arrays were added in version 4+ so that new branch I made should fix it for you 🤞
I tried the branch still didn't show the value on statusbar, but It didn't crash all the status bar this time which better than the main branch. Maybe still got anoher compatible issuses some where else. Anyway it's kind of you to check this tiny issue for me, thx!😺
What is the output of echo "$(df -h | awk '{if ($6 == "/") {print $4}}')"
? It's probably returning blank.
What about echo "$(df -h / | awk '{print $4}' | tail -n 1)"
? That relies less on awk, so maybe it will work!
Yes, you're right!
echo "$(df -h | awk '{if ($6 == "/") {print $4}}')"
returns blank
while
echo "$(df -h / | awk '{print $4}' | tail -n 1)"
return the df result
So that is where the problem is
Yay! Thanks for trying that 👍
I'm away from my computer at the moment but I'll merge a fix into the main branch tonight (8 hours from now)
Wow! Looking forward to it!
My df works under terminal, but nothing show when add plugin to status-right.