|
15 | 15 | # Should be set at the very top of interactive session settings |
16 | 16 | stty -ixon |
17 | 17 |
|
| 18 | +# Detect AI coding agent sessions that conflict with heavy prompt themes |
| 19 | +_is_agent_session() { |
| 20 | + [[ -n "$CURSOR_AGENT" || -n "$GEMINI_CLI" ]] |
| 21 | +} |
| 22 | + |
18 | 23 | # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. |
19 | 24 | # Initialization code that may require console input (password prompts, [y/n] |
20 | 25 | # confirmations, etc.) must go above this block; everything else may go below. |
21 | | -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-$(print -P %n).zsh" ]]; then |
| 26 | +if ! _is_agent_session && [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-$(print -P %n).zsh" ]]; then |
22 | 27 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-$(print -P %n).zsh" |
23 | 28 | fi |
24 | 29 |
|
@@ -52,7 +57,11 @@ ZSH_DISABLE_COMPFIX=true |
52 | 57 | # load a random theme each time Oh My Zsh is loaded, in which case, |
53 | 58 | # to know which specific one was loaded, run: echo $RANDOM_THEME |
54 | 59 | # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes |
55 | | -ZSH_THEME="powerlevel10k/powerlevel10k" |
| 60 | +if _is_agent_session; then |
| 61 | + ZSH_THEME="robbyrussell" |
| 62 | +else |
| 63 | + ZSH_THEME="powerlevel10k/powerlevel10k" |
| 64 | +fi |
56 | 65 |
|
57 | 66 | ENABLE_CORRECTION="true" |
58 | 67 | COMPLETION_WAITING_DOTS="true" |
|
160 | 169 | zstyle ':completion:*' special-dirs false |
161 | 170 |
|
162 | 171 | # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. |
163 | | -[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh |
| 172 | +! _is_agent_session && [[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh |
0 commit comments