Unverified Commit 2b259cf1 authored by Bruno Sutic's avatar Bruno Sutic
Browse files

Show spinner during the env save process

parent f9ad5990
# Changelog
### master
- show spinner during the save process
### v0.4.0, 2014-08-29
- change plugin name to `tmux-resurrect`. Change all the variable names.
......
......@@ -192,7 +192,7 @@ restore_active_and_alternate_sessions() {
main() {
if supported_tmux_version_ok && check_saved_session_exists; then
start_spinner
start_spinner "Restoring..." "Tmux restore complete!"
restore_all_panes
restore_pane_layout_for_each_window >/dev/null 2>&1
restore_all_pane_processes
......
......@@ -4,6 +4,7 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/scripts/variables.sh"
source "$CURRENT_DIR/helpers.sh"
source "$CURRENT_DIR/spinner_helpers.sh"
pane_format() {
local delimiter=$'\t'
......@@ -96,12 +97,14 @@ save_all() {
dump_windows >> $resurrect_file_path
dump_state >> $resurrect_file_path
ln -fs "$resurrect_file_path" "$(last_resurrect_file)"
display_message "Tmux environment saved!"
}
main() {
if supported_tmux_version_ok; then
start_spinner "Saving..." "Tmux environment saved!"
save_all
stop_spinner
display_message "Tmux environment saved!"
fi
}
main
start_spinner() {
$CURRENT_DIR/tmux_spinner.sh "Restoring tmux..." "Tmux restore complete!" &
$CURRENT_DIR/tmux_spinner.sh "$1" "$2" &
export SPINNER_PID=$!
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment