whame / tmux-modal

Execute complex tmux commands in just a few keystrokes with a modal mode that is designed to be efficient, easy to remember and comfortable
MIT License
172 stars 4 forks source link

Not able to enter modal mode #9

Closed dnguyenzd closed 1 year ago

dnguyenzd commented 1 year ago

I tried installing using tpm, and I can see tmux-modal folder in ~/.tmux/plugins, however M-m doesn't do anything. Other plugins installed with tpm are working fine

When I do tmux list-keys -T root, it doesn't have any keys registered by tmux-modal

I also tried putting run '~/.tmux/plugins/tmux-modal/tmux-modal.tmux' at the end of my .tmux.conf file but it's not working either

whame commented 1 year ago

Hm, that's weird. Could you try to run tmux-modal.tmux in a tmux session manually? I.e. in tmux do

./tmux-modal.tmux
dnguyenzd commented 1 year ago

I got this error when executing it directly:

/tmux-modal.tmux: line 27: syntax error near unexpected token `&'

look like this is one of those special cases of list-keys that the script misses to handle. I attached here the output of tmux list-keys for reference

tmux-list-keys.txt

whame commented 1 year ago

Ah no, this is bash reporting a syntax error. I think you are using a too old bash version. Could you report what

bash --version

says? I'm guessing that you are using version older than 4.0. That syntax was introduced in bash 4.0 (which is more than 10 years ago...).

dnguyenzd commented 1 year ago

you are right, I'm using default bash version from MacOS, which is 3.2.57 using latest bash from brew fixes it

it might be worth mentioning bash version requirement as prerequisite though because as I know, Apple will not ship newer version of bash due to licensing, so a lot of people have version 3 by default

whame commented 1 year ago

Aha interesting! We would like MacOS users to use this plugin without any hassles of course. Maybe the switch-case can be rewritten to be portable?

For now, I'll add a check for bash version. Thank you!

bradfordwagner commented 1 year ago

@dnguyenzd - I was able to get this working on a mac. I ran to use the brew installed version of bash which refd bash 5.x brew link --overwrite bash Just make sure it is the winner in your PATH resolution.