laktak / extrakto

extrakto for tmux - quickly select, copy/insert/complete text without a mouse
MIT License
878 stars 45 forks source link

extrakto should support zsh (without bash)? #113

Closed udiNur closed 4 months ago

udiNur commented 8 months ago

error: extrakto needs a newer Bash On macOS you need to install/update it with Homebrew.

image
laktak commented 8 months ago

I've no interest in zsh. Are the instructions not clear? You need to go to https://brew.sh

AndydeCleyre commented 6 months ago

I think a better form of this issue would be a request to drop Bash as a dependency, which could for example be achieved by porting the three Bash scripts to POSIX shell.

The current title makes it sound like you can't use extrakto with a Zsh session, which is untrue.

ilyagr commented 6 months ago

I think it'd help a lot simply if extrakto gave these instructions (or a link to them) and an error message when run on Mac OS's default bash. IIRC, it just showed a confusing blank screen as of a few months ago.

(OTOH, this may have been fixed judging by the screenshot, so perhaps my comment is out of date).

Installing bash is not hard; knowing that this is the problem is harder at the moment.


I'm not sure how much work it would be to make extrakto run on POSIX sh, but I do know that even then the old version of bash that ships with Mac OS has some problems relative to /bin/dash (which is installed on Mac OS, but not the default).

laktak commented 6 months ago

On the mac, extrakto should display the following if it's not running on a supported bash:

error: extrakto needs a newer Bash
On macOS you need to install/update it with Homebrew.

A possible solution would be to convert the bash scripts to python as that is already a requirement and much easier to maintain than POSIX shell. Not sure if it's worth the effort though as installing Bash is very easy.

AndydeCleyre commented 6 months ago

@laktak I hear you about maintaining POSIX shell, but if such a PR were submitted, would it be considered? Would a Python port PR be considered?

laktak commented 6 months ago

Posix not so much for the reasons cited above. But I'd certainly consider a PR to replace Bash with Python.

laktak commented 5 months ago

I have a branch that replaces Bash with Python and posix sh where needed.

Please try it and let me know if it works.

laktak commented 5 months ago

with TPM this should work: set -g @plugin 'laktak/extrakto#python-posix'

laktak commented 4 months ago

It's now on master.