done
done copied to clipboard
"basename: illegal option -- f" error when using with Tmux
I'm running into an odd error where this error appears when using fish with Tmux. It's almost always reproduceable when ran with neovim, but can often appear when just using tmux.
~ > sleep 4
basename: illegal option -- f
usage: basename string [suffix]
basename [-a] [-s suffix] string [...]
How to reproduce:
tmux # open tmux
nvim -u NONE '+:terminal' # open neovim with a terminal
sleep 4
Environment info:
- os: MacOS 11.6
- shell: fish 3.3.1
- tmux 3.2a
- Neovim 0.5.1
- terminal: Hyper
Thank you for all your hard work with done
!
From what I can tell, this happens here:
while set tmux_fish_ppid (ps -o ppid= -p $tmux_fish_pid | string trim)
and ! string match -q "tmux*" (basename (ps -o command= -p $tmux_fish_ppid)) #<==
set tmux_fish_pid $tmux_fish_ppid
end
because tmux_fish_ppid
is not available, the ps
command gets this error
ps: option requires an argument -- p
Changing it to a hardcoded fish
makes things work:
while set tmux_fish_ppid (ps -o ppid= -p $tmux_fish_pid | string trim)
- and ! string match -q "tmux*" (basename (ps -o command= -p $tmux_fish_ppid))
+ and ! string match -q "tmux*" fish
set tmux_fish_pid $tmux_fish_ppid
end
This is solved by this pull request: https://github.com/franciscolourenco/done/pull/124
I'm also seeing this issue. Not sure why, but it just started appearing for me. (Ah from #124 I see that it's because I am now setting a start directory in Tmux).
Fixed by #124. Please reopen if needed.