don't auto-start configuration wizard if it's likely that zshrc is broken

This change is an attempt to automate this:
https://github.com/romkatv/powerlevel10k#configuration-wizard-runs-automatically-every-time-zsh-is-started
This commit is contained in:
Roman Perepelitsa 2021-11-15 07:25:17 +01:00
commit a9f208c8fc
2 changed files with 76 additions and 43 deletions

View file

@ -59,7 +59,10 @@ function _p9k_can_configure() {
$0_error "terminal size too small; must be at least $__p9k_wizard_columns columns by $__p9k_wizard_lines lines"
return 1
}
[[ -t 0 && -t 1 ]] || { $0_error "no TTY"; return 2 }
[[ -t 0 && -t 1 ]] || {
$0_error "no TTY"
return 2
}
return 0
} always {
unfunction $0_error