From b3a3c2e67d6e732fe29c396403477474deef3fc4 Mon Sep 17 00:00:00 2001 From: Geoff Harcourt Date: Fri, 13 Nov 2015 18:23:47 -0500 Subject: [PATCH] Don't export `$PS1` The `$PS1` variable does not need to be exported in order for `zsh` to use its contents to set prompt options. `export`ing it has the negative side-effect of polluting prompts in shells launched from `zsh`. The `export`ing of `$PS1` is the cause of #270, where using `sudo su` to become another user (launching a non-`zsh` shell) resulted in a corrupted prompt. Removing the `export` will allow `sh`/`bash`/`dash` and other shells to be launched from `zsh` without inheriting its prompt settings. Fix #270. --- zsh/configs/prompt.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/configs/prompt.zsh b/zsh/configs/prompt.zsh index ea46789..27a01d0 100644 --- a/zsh/configs/prompt.zsh +++ b/zsh/configs/prompt.zsh @@ -6,4 +6,4 @@ git_prompt_info() { fi } setopt promptsubst -export PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%c%{$reset_color%}$(git_prompt_info) %# ' +PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%c%{$reset_color%}$(git_prompt_info) %# '