aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-02-27 20:28:30 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-02-27 20:28:30 +0300
commitb0c051cdfd39ed20488360a63496674cee234148 (patch)
treea9f9118fe2e3b0b70750c6c049a570b43c0c0da7 /internal
parentc5732cc810b61a1ce6e2a4e996f77f6bd7b26b2f (diff)
save and restore screen in the wizard
Diffstat (limited to 'internal')
-rw-r--r--internal/notes.txt1
-rwxr-xr-xinternal/wizard.zsh20
2 files changed, 16 insertions, 5 deletions
diff --git a/internal/notes.txt b/internal/notes.txt
index 77954846..6c0b154e 100644
--- a/internal/notes.txt
+++ b/internal/notes.txt
@@ -30,7 +30,6 @@
emulate zsh -o prompt_percent -c 'print -P "%F{#ff0000}red%F{green}%B bold green"'
- bug: open a new tab and hit ctrl-p. an empty line will appear before prompt.
- zsh-syntax-highlighting added two precommands: chronic and ifne.
-- use this in wizard: https://wiki.bash-hackers.org/snipplets/screen_saverestore
- add POWERLEVEL9K_MODE=ascii
- add ascii version of lean style (both color versions); hopefully without creating new files.
- wizard: if the font seems very weak, add another question about ❯. if it's not visible, go ascii.
diff --git a/internal/wizard.zsh b/internal/wizard.zsh
index 8e4a0efa..6dc380bd 100755
--- a/internal/wizard.zsh
+++ b/internal/wizard.zsh
@@ -14,6 +14,8 @@ if (( OPTIND <= ARGC )); then
return 1
fi
+(( $+terminfo[smcup] && $+terminfo[rmcup] )) && echoti smcup
+
local -ri force
local -r font_base_url='https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts'
@@ -201,7 +203,12 @@ function quit() {
if [[ $1 == '-c' ]]; then
print -P ""
else
- clear
+ if (( $+terminfo[smcup] && $+terminfo[rmcup] )); then
+ echoti rmcup
+ print
+ else
+ clear
+ fi
fi
if (( force )); then
print -P "Powerlevel10k configuration wizard has been aborted. To run it again, type:"
@@ -1632,8 +1639,8 @@ function ask_config_overwrite() {
q) quit;;
r) return 1;;
y)
- config_backup="$(mktemp ${TMPDIR:-/tmp}/$__p9k_cfg_basename.XXXXXXXXXX)" || exit 1
- cp $__p9k_cfg_path $config_backup || exit 1
+ config_backup="$(mktemp ${TMPDIR:-/tmp}/$__p9k_cfg_basename.XXXXXXXXXX)" || quit -c
+ cp $__p9k_cfg_path $config_backup || quit -c
config_backup_u=${${TMPDIR:+\$TMPDIR}:-/tmp}/${(q-)config_backup:t}
break
;;
@@ -2162,7 +2169,12 @@ while true; do
break
done
-clear
+if (( $+terminfo[smcup] && $+terminfo[rmcup] )); then
+ echoti rmcup
+ print
+else
+ clear
+fi
flowing +c New config: "%B${__p9k_cfg_path_u//\\/\\\\}%b."
if [[ -n $config_backup ]]; then