scmbreeze / scm_breeze

Adds numbered shortcuts to the output git status, and much more
https://madebynathan.com/2011/10/19/git-shortcuts-like-youve-never-seen-before/
MIT License
2.82k stars 192 forks source link

Broken `scmb_wrapped_shell_commands` in ZSH #284

Closed p-himik closed 4 months ago

p-himik commented 5 years ago

Commit a6eeebfa91e51ec7aae21f65e0df49e461a4ca68 breaks scmb_wrapped_shell_commands in ZSH. It makes the loop make only one iteration with cmd being equal to scmb_wrapped_shell_commands. The workaround is to write scmb_wrapped_shell_commands in the config not as a string but as an array.

ghthor commented 5 years ago

I assume that's the workaround you're using personally from you zsh configuration? There's got to be a way to fix the internal code that's functional for zsh+bash. I'm sorry about your zsh issues, I've been meaning to run zsh personally and just haven't made the push yet.

p-himik commented 5 years ago

Indeed, I just changed my local configuration, only not of zsh but of scm_breeze in .git.scmbrc.

ghthor commented 5 years ago

Right, You've change the declaration in .git.scmbrs from a space separated string into a array literal?

I think we can't support that official because array literals are a recent bash feature? If I'm wrong about this, I blame bash, well I blame bash anyway. At any rate there is a way to fix this at the usage site and lemme see if I can hack it together and get it tested today.

On Thu, Feb 14, 2019 at 5:43 AM Eugene Pakhomov notifications@github.com wrote:

Indeed, I just changed my local configuration, only not of zsh but of scm_breeze in .git.scmbrc.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/scmbreeze/scm_breeze/issues/284#issuecomment-463580448, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJyKkurQalz-SUIq8FcplrER54eQfioks5vNT29gaJpZM4a3v_r .

p-himik commented 5 years ago

Yep, now it just looks something like ("vim" "rm" "mv"). Sorry, I have no idea what versions of bash support this feature.

HaleTom commented 5 years ago

In #260 we established minimum shell versions:

bash: 4.3.11(1)
zsh: 5.0.2

Both of these support arrays.

There's a zsh gotcha mentioned in #260 also, which may or may not be relevant.

To enable proper quoting, arrays are sometimes required (see my largish PR for instance), eg if one argument token contains spaces for instance.

I see this as a documentation bug rather than a code bug.