gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
21.73k stars 3.34k forks source link

<prefix> e (edit configuration) does not work #679

Closed wangduanduan closed 9 months ago

wangduanduan commented 10 months ago

.tmux version

* fd1bbb5 (HEAD -> master, origin/master, origin/HEAD) fixed TMUX_PROGRAM introspection on FreeBSD, fixes #639
* 2a6145d we don't rely on TPM to scan configuration files anymore

tmux version

➜  ~ ls -al ~ | grep tmux
drwxr-xr-x  4 wangdd wangdd  4096 10月29日 10:30 .tmux
lrwxrwxrwx  1 wangdd wangdd    16 10月29日 10:30 .tmux.conf -> .tmux/.tmux.conf
-rw-r--r--  1 wangdd wangdd 16272 10月29日 10:30 .tmux.conf.local

➜  ~ tmux -V
tmux 3.3a

EDITOR

➜  ~ echo $EDITOR
nvim
➜  ~ which nvim
/usr/bin/nvim

when press <c-b> e, nothing happen,

416

wangduanduan commented 10 months ago
➜  ~ rg 'bind e' .tmux.conf
31:bind e new-window -n "#{TMUX_CONF_LOCAL}" sh -c '${EDITOR:-vim} "$TMUX_CONF_LOCAL" && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
wangduanduan commented 10 months ago

after install vim, the <prefix - e> worked !

i use zsh, but the sh -c use bash, may be the bash can not find $EDITOR

gpakosz commented 10 months ago

Hello @wangduanduan,

Where do you define EDITOR to nvim? In your ~/.zshrc?

wangduanduan commented 10 months ago

Hello @wangduanduan,

Where do you define EDITOR to nvim? In your ~/.zshrc?

yes, in .zshrc

gpakosz commented 9 months ago

Hello @wangduanduan 👋

Can you please uninstall vim and try again with the gh-679 branch?

minhtung0404 commented 6 months ago

I don't think this fix is working on my MacOS M1. I simply replaced "EDITOR=$EDITOR" to "EDITOR=nvim" and it works.

My tmux version is 3.4. The repository I just downloaded today so it should be up-to-date.

Maybe this will help reproduce the problem (or maybe it is just my computer):

:new-window -e "EDITOR=$EDITOR" sh -c '$EDITOR'

where $EDITOR is set to something that is not defined in sh.

gpakosz commented 6 months ago

The EDITOR environment variable has to be set outside of tmux

minhtung0404 commented 6 months ago

yes I did set it on my .zshrc file.

gpakosz commented 6 months ago

You need to relaunch the tmux server process

minhtung0404 commented 6 months ago

Thank you. Look like it is working for me now.

But I don't really understand why. Yesterday I tried to kill the session and create a new one but it still does not work. Today I tried pkill -f tmux then start another session and it works.

gpakosz commented 6 months ago

🤷‍♂️