Madeleine Smith
Madeleine Smith

Reputation: 481

Oh-my-zsh theme not rendering properly in IntelliJ

Cobalt2 theme does not render properly in the terminal in IntelliJ but works fine in the Mac terminal. How do I correct this?

Upvotes: 25

Views: 15153

Answers (7)

Shawn Butterfield
Shawn Butterfield

Reputation: 21

My p10k theme was borked in the IntelliJ integrated terminal after updating to 2024.1.1 recently. The previous solutions didn't work for me, but I noticed there was a different env property set consistently that I applied to a prior suggestion and it unblocked me.

Altering my ~/.zshrc as follows unblocked me...

  • OS macOS 14.5 (23F79)

#ZSH_THEME="powerlevel10k/powerlevel10k"
if [[ $IDEA_INITIAL_DIRECTORY ]]; then
  ZSH_THEME="robbyrussell"
else
  ZSH_THEME="powerlevel10k/powerlevel10k"
fi

Upvotes: 2

bilalm
bilalm

Reputation: 1

Restart configuration in IntelliJ terminal with p10k configure command and use powerlevel10k recommended fonts (MesloLGS NF).

  1. Download all MesloLGS NF fonts here and install: https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#manual-font-installation.
  2. Open IntelliJ settings and navigate Editor -> Color Scheme -> Console Font and choose MesloLGS NF font. Save and exit.
  3. Open IntelliJ terminal and navigate .zshrc directory with cd command.
  4. Start powerlevel10k configuratin here again with p10k configure command.

I tested on PHPStorm 2023.3.6 and it is working good now.

Upvotes: 0

Diovi Robinet Morales
Diovi Robinet Morales

Reputation: 21

Select the "JetBrains Mono" font in the Console Fonts option.

Upvotes: 2

maximus
maximus

Reputation: 1558

I'm using IntelliJ 2022.1.1 CE + Oh-My-Zsh + Powerlevel10k, below setting made it work for me:

  • Go to "IntelliJ -> Preferences -> Appearance -> Themes" and select "Sync with OS"
  • Restart IntelliJ

enter image description here

Result: enter image description here

Credit: this answer is inspired by the answer from @Kyle Pillay.

Upvotes: 17

BaronVonKaneHoffen
BaronVonKaneHoffen

Reputation: 2000

Thought I'd add for anyone Googling this "zsh themes being broken in IntelliJ" ...especially Powerlevel10k ... you can conditionally switch the theme to a compatible one for your IntelliJ console, and keep the nice one for your main terminal. In .zshrc :

if [[ $__INTELLIJ_COMMAND_HISTFILE__ ]]; then
  ZSH_THEME="robbyrussell"
else
  ZSH_THEME="powerlevel10k/powerlevel10k"
fi

Hope that helps someone :-)

Upvotes: 26

Kyle Pillay
Kyle Pillay

Reputation: 36

Changing the color scheme in IntelliJ to the same color scheme you're using in your OS terminal should solve this.

I'm using the Dracula Theme in iTerm2, and I installed the IDE color scheme from here Jetbrains Dracula Theme and it's all displaying as expected.

Here's what my PHPStorm terminal looks like now.

IntelliJ(PHPStorm) Terminal with Dracula Theme

Upvotes: 2

CrazyCoder
CrazyCoder

Reputation: 402325

Please follow this known bug for updates:

Upvotes: 5

Related Questions