Use display-message for progress
This commit is contained in:
parent
b699a7e01c
commit
0b01d75cb0
5 changed files with 23 additions and 0 deletions
|
@ -34,8 +34,10 @@ clean_plugins() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
set_long_tmux_display_time
|
||||||
ensure_tpm_path_exists
|
ensure_tpm_path_exists
|
||||||
clean_plugins
|
clean_plugins
|
||||||
|
tmux set-option -g display-time "$org_display_time" # Restore display-time
|
||||||
exit_value_helper
|
exit_value_helper
|
||||||
}
|
}
|
||||||
main
|
main
|
||||||
|
|
|
@ -4,6 +4,7 @@ _has_emacs_mode_keys() {
|
||||||
|
|
||||||
tmux_echo() {
|
tmux_echo() {
|
||||||
local message="$1"
|
local message="$1"
|
||||||
|
tmux display-message "$message"
|
||||||
tmux run-shell "echo '$message'"
|
tmux run-shell "echo '$message'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ echo_ok() {
|
||||||
|
|
||||||
echo_err() {
|
echo_err() {
|
||||||
tmux_echo "$*"
|
tmux_echo "$*"
|
||||||
|
sleep 3 # Give some time for error message to be displayed in status bar
|
||||||
}
|
}
|
||||||
|
|
||||||
end_message() {
|
end_message() {
|
||||||
|
|
|
@ -15,3 +15,18 @@ exit_value_helper() {
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
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
|
||||||
|
}
|
||||||
|
|
|
@ -67,9 +67,11 @@ verify_tpm_path_permissions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
set_long_tmux_display_time
|
||||||
ensure_tpm_path_exists
|
ensure_tpm_path_exists
|
||||||
verify_tpm_path_permissions
|
verify_tpm_path_permissions
|
||||||
install_plugins
|
install_plugins
|
||||||
|
tmux set-option -g display-time "$org_display_time" # Restore display-time
|
||||||
exit_value_helper
|
exit_value_helper
|
||||||
}
|
}
|
||||||
main
|
main
|
||||||
|
|
|
@ -62,12 +62,14 @@ update_plugins() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
set_long_tmux_display_time
|
||||||
ensure_tpm_path_exists
|
ensure_tpm_path_exists
|
||||||
if [ "$1" == "all" ]; then
|
if [ "$1" == "all" ]; then
|
||||||
update_all
|
update_all
|
||||||
else
|
else
|
||||||
update_plugins "$*"
|
update_plugins "$*"
|
||||||
fi
|
fi
|
||||||
|
tmux set-option -g display-time "$org_display_time" # Restore display-time
|
||||||
exit_value_helper
|
exit_value_helper
|
||||||
}
|
}
|
||||||
main "$*"
|
main "$*"
|
||||||
|
|
Loading…
Reference in a new issue