tmux-plugins / tpm

Tmux Plugin Manager
MIT License
11.68k stars 415 forks source link

Escape bindings dir #269

Open baodrate opened 8 months ago

baodrate commented 8 months ago

Currently, the bind-key commands fail if BINDINGS_DIR (via TPM's installation path) contains characters that need to be escaped in sh-syntax. The most obvious example is spaces.

e.g. TMUX_PLUGIN_MANAGER_PATH=/Users/foobar/Library/Application Support/tmux/plugins causes install_key to be bound to sh -c /Users/foobar/Library/Application Support/tmux/plugins/tpm/bindings/install_plugins which is interpreted as the command /Users/foobar/Library/Application with a single argument of Support/tmux/plugins/tpm/bindings/install_plugins.

This PR fixes this by using tmux's built-in sh-escaping (the #{q:...} format string syntax). This requires a new tmux environment variable.

baodrate commented 8 months ago

Also fixed sh word splitting breaking silently_source_all_tmux_files in scripts/source_plugins.sh