1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-22 04:10:07 +00:00

save and restore screen in the wizard

This commit is contained in:
romkatv 2020-02-27 18:28:30 +01:00
parent c5732cc810
commit b0c051cdfd
3 changed files with 18 additions and 7 deletions

View file

@ -1165,8 +1165,8 @@ parameters are defined. Based on your prompt style choices, the configuration wi
source this file. The next time you start Zsh, the configuration wizard shouldn't run automatically. source this file. The next time you start Zsh, the configuration wizard shouldn't run automatically.
If it does, this means the evaluation of `~/.zshrc` terminates prematurely before it reaches the If it does, this means the evaluation of `~/.zshrc` terminates prematurely before it reaches the
line that sources `~/.p10k.zsh`. This most often happens due to syntax errors in `~/.zshrc`. These line that sources `~/.p10k.zsh`. This most often happens due to syntax errors in `~/.zshrc`. These
errors get hidden by the configuration wizard screen, so you don't notice them. Scroll up in the errors get hidden by the configuration wizard screen, so you don't notice them. When you exit
first configuration wizard screen to see these errors. Alternatively, run configuration wizard, look for error messages. You can also use
`POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true zsh` to start Zsh without automatically running the `POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true zsh` to start Zsh without automatically running the
configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of them. configuration wizard. Once you can see the errors, fix `~/.zshrc` to get rid of them.

View file

@ -30,7 +30,6 @@
emulate zsh -o prompt_percent -c 'print -P "%F{#ff0000}red%F{green}%B bold green"' 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. - 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. - 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 POWERLEVEL9K_MODE=ascii
- add ascii version of lean style (both color versions); hopefully without creating new files. - 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. - wizard: if the font seems very weak, add another question about . if it's not visible, go ascii.

View file

@ -14,6 +14,8 @@ if (( OPTIND <= ARGC )); then
return 1 return 1
fi fi
(( $+terminfo[smcup] && $+terminfo[rmcup] )) && echoti smcup
local -ri force local -ri force
local -r font_base_url='https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts' 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 if [[ $1 == '-c' ]]; then
print -P "" print -P ""
else else
clear if (( $+terminfo[smcup] && $+terminfo[rmcup] )); then
echoti rmcup
print
else
clear
fi
fi fi
if (( force )); then if (( force )); then
print -P "Powerlevel10k configuration wizard has been aborted. To run it again, type:" print -P "Powerlevel10k configuration wizard has been aborted. To run it again, type:"
@ -1632,8 +1639,8 @@ function ask_config_overwrite() {
q) quit;; q) quit;;
r) return 1;; r) return 1;;
y) y)
config_backup="$(mktemp ${TMPDIR:-/tmp}/$__p9k_cfg_basename.XXXXXXXXXX)" || exit 1 config_backup="$(mktemp ${TMPDIR:-/tmp}/$__p9k_cfg_basename.XXXXXXXXXX)" || quit -c
cp $__p9k_cfg_path $config_backup || exit 1 cp $__p9k_cfg_path $config_backup || quit -c
config_backup_u=${${TMPDIR:+\$TMPDIR}:-/tmp}/${(q-)config_backup:t} config_backup_u=${${TMPDIR:+\$TMPDIR}:-/tmp}/${(q-)config_backup:t}
break break
;; ;;
@ -2162,7 +2169,12 @@ while true; do
break break
done done
clear if (( $+terminfo[smcup] && $+terminfo[rmcup] )); then
echoti rmcup
print
else
clear
fi
flowing +c New config: "%B${__p9k_cfg_path_u//\\/\\\\}%b." flowing +c New config: "%B${__p9k_cfg_path_u//\\/\\\\}%b."
if [[ -n $config_backup ]]; then if [[ -n $config_backup ]]; then