aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2021-10-14 15:38:27 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2021-10-14 15:38:27 +0300
commit6441a01dd361c2b8aee7f95801fb896fc35f066b (patch)
tree31a5364fff3b170648d53e43cc6fc7cb5f19d829 /internal/p10k.zsh
parentedd98053cc96a8d2bd50f2b5f18a97fec0a96b26 (diff)
survive non-writable $TTY
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 976f6e8b..3afac53f 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -8645,6 +8645,13 @@ _p9k_init() {
if (( $+__p9k_instant_prompt_erased )); then
unset __p9k_instant_prompt_erased
+ if [[ -w $TTY ]]; then
+ local tty=$TTY
+ elif [[ -w /dev/tty ]]; then
+ local tty=/dev/tty
+ else
+ local tty=/dev/null
+ fi
{
>&2 echo -E - ""
>&2 echo -E - "${(%):-[%1FERROR%f]: When using instant prompt, Powerlevel10k must be loaded before the first prompt.}"
@@ -8684,7 +8691,7 @@ _p9k_init() {
>&2 echo -E - "${(%):- * You %Bwill%b see this error message every time you start zsh.}"
>&2 echo -E - "${(%):- * Zsh will start %Bslowly%b.}"
>&2 echo -E - ""
- } 2>>$TTY
+ } 2>>$tty
fi
}