If you update the plugin with TPM, the `thumbs` binary can get out of
sync. So we need to check the version before proceed.
If there is a version mismatch, then we run a new install in "update"
mode.
If cargo exists, use it. Otherwise, if the combination of platform and
architecture has a precompiled binary, then use it.
Thanks @fcsonline for the help 🙇
bbf677fda3 ("Improve the matrix of releases") included a fix to cope
with compiled and bundled installations. However, the check for the
.git/ repository is done from where tmux is launched, not where
tmux-thumbs is installed, so RELEASE_DIR is not properly set always.
This leads to tmux-thumbs always trying to install itself when installed
via tmux-plugin-manager.
[[ ${VALUE} ]] means "expand the VALUE variable, splitting on spaces,
and pass those words as arguments to [[…]]". So if VALUE was the string
'-n blah' then that would expand to '[[ -n blah ]]' which is meaningful
but not at all what was intended.
Instead it appears this intented to check for a non-empty string.
This isn't an interactive script. Any relevant environment should
already be inherited from tmux, and sourcing ~/.bash_profile may cause
~/.bashrc to be sourced with unexpected effects.
OSC52 support was implemented before two major refactors in tmux-thubs:
- Decouple tmux-thumbs from tmux
- Removal of rustbox with termion
I'm not sure if is the right decision, but I moved the arguments to
swapper land because it looks like more tmux related. If it makes sense
for other terminals to support this we can move it back.
The question we need to answer here if it makes sense for standalone `thumbs`:
```
cat sample/test1 | ./target/release/thumbs --osc52
```
Previously, when setting the `--command` option to `tmux set-buffer {}`, it
will be interpreted by the `tmux-thumbs` binary as 4 separate args:
`--command`, `'tmux`, `set-buffer`, and `{}'`. This commit fixes it such that
the option will be correctly interpreted as a single arg.
Add an option to surround the hint character with square brackets
(for example `[a]` rather than `a`). This is the equivalent to the
following `tmux-fingers` configuration option [1] and is useful to make
the hint more visible:
```
set -g @fingers-compact-hints 0
```
[1] - https://github.com/Morantron/tmux-fingers#fingers-compact-hints
Signed-off-by: James O. D. Hunt <jamesodhunt@gmail.com>