gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
21.73k stars 3.34k forks source link

Don't set any rm -rf conditional variables to true, and check their existence too #663

Closed 0-issue closed 5 months ago

0-issue commented 1 year ago

Please don't default anything with rm -rf anywhere in your code. One example is the following, something happened and I lost all my local edits because oh my tmux deleted all of the plugin directories!!!!!! Also, the option seems to not have been present in my older .tmux.conf.local which could have led to this disaster after updating the system.

#   tmux_conf_uninstall_plugins_on_reload=${tmux_conf_uninstall_plugins_on_reload:-true}

and related disaster code in .tmux.conf

#     if _is_true "$tmux_conf_uninstall_plugins_on_reload" && [ -d "$TMUX_PLUGIN_MANAGER_PATH/tpm" ]; then
#       tmux display 'Uninstalling tpm and plugins...'
#       rm -rf "$TMUX_PLUGIN_MANAGER_PATH"
#       tmux display 'Done uninstalling tpm and plugins...'
gpakosz commented 1 year ago

Hello @amanvm 👋

I'm sorry this happened to you.

There's unfortunately no way of having Oh my tmux! manage TPM plugins and uninstall them without deleting them from drive.

I'll look into how this could be improved.