joshmedeski / tmux-nerd-font-window-name

Nerd Font icons for your tmux windows
145 stars 29 forks source link

yq missing although it's installed? #39

Closed mrt181 closed 4 months ago

mrt181 commented 4 months ago

I have installed yq

sudo snap install yq

But i still get grafik

I also added a symlink

ln -s /snap/yq/current/bin/yq ~/.local/bin/yq

But that also did not help

>>> ~ >>> which yq
/home/martin/.local/bin/yq

>>> ~ >>> yq --version
yq (https://github.com/mikefarah/yq/) version v4.44.2
joshmedeski commented 4 months ago

Please add this to your ~/.bashrc file and try again:

export PATH="$PATH:~/.local/bin"
mrt181 commented 4 months ago

Ok tried that but does not work grafik

joshmedeski commented 4 months ago

Did you try restarting your computer? Maybe the tmux server is missing something.

mrt181 commented 4 months ago

I tried

tmux kill-server & tmux

and also

wsl --shutdown

but the problem persists

mrt181 commented 4 months ago

I also switched to bash directly and execute the check in your code grafik

joshmedeski commented 4 months ago

What version of bash are you on? I suspect it's an older version of bash and the if statement is incompatible.

I recommend updating to a newer version of bash and trying again.

mrt181 commented 4 months ago

This is my bash version


> bash --version
GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
mrt181 commented 4 months ago

running your script directly works

>…/tmux-nerd-font-window-name/bin > ./tmux-nerd-font-window-name fish 0
 fish

>…/tmux-nerd-font-window-name/bin > ./tmux-nerd-font-window-name nvim 0
 nvim
joshmedeski commented 4 months ago

I did some additional research and I'm currently stumped. I'm guessing it has something to do with WSL and PATH resolution from inside TMUX.

I typically see Ubuntu and apt-get being used in WSL, since you're using snap perhaps there's something missing. Perhaps you can manually change the line of code that calls yq to verify that it's a path issue.

-if ! command -v yq >/dev/null 2>&1; then
+if ! command -v /home/martin/.local/bin/yq >/dev/null 2>&1; then

I understand this isn't a good permanent solution, but hopefully it can isolate the issue. Please let me know if you're able to figure out what it is and I can potentially update the README to warn people about certain environments.

mrt181 commented 4 months ago

ok, I did this

-if ! command -v yq >/dev/null 2>&1; then
+if ! command -v $HOME/.local/bin/yq >/dev/null 2>&1; then

This gets rid of the missing message but now the window name and icon are missing grafik

mrt181 commented 4 months ago

I am using

I also tried on my linux box and there it also does not work out-of-the-box. I had to add a symbolic link to the snap yq app to make it work on linux.

The yq intallation notes tell me to use snap for linux/ubuntu

mrt181 commented 4 months ago

On my windows machine, I have installed yq by downloading it to usr/bin. This makes it work.

snap seems to messing it up somehow.

joshmedeski commented 4 months ago

Glad it's working!