This commit is contained in:
Jacob Lundqvist 2022-04-15 11:00:48 +02:00 committed by GitHub
commit bf385f9371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 2 deletions

View File

@ -18,7 +18,6 @@ source "$HELPERS_DIR/tmux_utils.sh"
display_plugin_update_list() {
local plugins="$(tpm_plugins_list_helper)"
tmux_echo "Installed plugins:"
tmux_echo ""
for plugin in $plugins; do
# displaying only installed plugins

View File

@ -34,8 +34,10 @@ clean_plugins() {
}
main() {
set_long_tmux_display_time
ensure_tpm_path_exists
clean_plugins
tmux set-option -g display-time "$org_display_time" # Restore display-time
exit_value_helper
}
main

View File

@ -4,6 +4,7 @@ _has_emacs_mode_keys() {
tmux_echo() {
local message="$1"
tmux display-message "$message"
tmux run-shell "echo '$message'"
}
@ -13,6 +14,7 @@ echo_ok() {
echo_err() {
tmux_echo "$*"
sleep 3 # Give some time for error message to be displayed in status bar
}
end_message() {

View File

@ -15,3 +15,18 @@ exit_value_helper() {
exit 0
fi
}
set_long_tmux_display_time() {
#
# Since tmux display is used to indicate progress, save original
# display-time and temporarily set it to 2 minutes.
# New messages will overwrite previous, so this is not blocking anything.
# It is just a random long time to ensure that the messages don't time-out.
#
# Use this to restore the original display-time before exiting:
#
# tmux set-option -g display-time "$org_display_time"
#
org_display_time="$(tmux show-options -g display-time | awk '{print $2}')"
tmux set-option -g display-time 120000
}

View File

@ -67,9 +67,11 @@ verify_tpm_path_permissions() {
}
main() {
set_long_tmux_display_time
ensure_tpm_path_exists
verify_tpm_path_permissions
install_plugins
tmux set-option -g display-time "$org_display_time" # Restore display-time
exit_value_helper
}
main

View File

@ -34,7 +34,6 @@ update() {
update_all() {
echo_ok "Updating all plugins!"
echo_ok ""
local plugins="$(tpm_plugins_list_helper)"
for plugin in $plugins; do
IFS='#' read -ra plugin <<< "$plugin"
@ -62,12 +61,14 @@ update_plugins() {
}
main() {
set_long_tmux_display_time
ensure_tpm_path_exists
if [ "$1" == "all" ]; then
update_all
else
update_plugins "$*"
fi
tmux set-option -g display-time "$org_display_time" # Restore display-time
exit_value_helper
}
main "$*"