srsudar/tmux-completion

Merging upstream

aprokop opened this issue · 4 comments

In your README you point to http://bash-completion.alioth.debian.org/. Right now it redirects to a new place: https://github.com/scop/bash-completion, which I believe is the new upstream (for instance, Fedora directly sources it).

Right now, scop/bash-completion has no support for tmux. It would be ideal if we could merge your script to upstream. If necessary, I could provide help to do that (though I'm a newbie to completions).

This is a great idea. I've opened a PR on that project. I made a few changes to the file there to be in line with their contributing guidelines and to clarify comments, etc.

One of the maintainers of that project decided to reject the PR for pretty compelling reasons. I'll sum up here for posterity.

  • In general they prefer when possible for completions to be packaged with the tool itself, i.e. that the tmux project would ship its own completions.
  • tmux itself recommends in their README a different completion script. That script gives me errors, but it does try to do fancier things than this script does. I would believe that when it's working (or maybe just properly configured?) it is a superior option. The bash-completion folks feel it would be odd to incorporate a different completion script than what tmux itself recommends, which is a good point.
  • They also suggest several problems with the script they'd want addressed. Most of these are beyond my interest at the moment, though the requests are solid. Two especially compelling selections:
    • They aren't fans of the hard-coded list of commands in the script, which is another fair point. I forget where I got that, but I agree it would be preferable to generate the list.
    • The check I'm doing to see if tmux isn't started is to look at the error message, which might not be locale-independent.
  • Finally, no one at bash-completion uses tmux, and they are more comfortable merging scripts that maintainers use. They didn't rule it out, but suggest that we'd have to argue to get it merged.

So, I'm going to close. Take a look at that PR if you want more details.

I actually don't use this script anymore myself, as I have switched to zsh. If you're interested enough in completions to be opening this issue, imo it's worth checking out zsh unless you're limited to a bash-only environment for some reason. The bash-completion people even include this in their README. Made me lol. I couldn't resist.

Q. Is bash the be-all-and-end-all of completion as far as shells go?

A. Absolutely not. zsh has an extremely sophisticated completion system that offers many features absent from the bash implementation. Its users often cannot resist pointing this out. More information can be found at: http://www.zsh.org/

[edit: first sentence typo.]

@srsudar Thank you for all the legwork you've done. The situation is much clearer now. It is still interesting that tmux recommends an external tmux completion rather than including in its source.
I'll take a look at zsh.

FWIW, zprezto is the project I use to bootstrap my zsh experience. It gives you some powerful defaults out of the box. From there you can move to customizing themes and things. I always find the installation instructions confusing, but they eventually work after I remove typos and things. A daunting thing to change your shell, though. =)