Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

IntelliJ IDEA fails to load zsh environmentΒ #567

@haneo3o

Description

@haneo3o

Prerequisites

  • I've checked the existing issues and I'm not duplicating a report.
  • I've checked the zimfw Changelog and I'm not being affected by documented changes.
  • I've checked the Zim Framework πŸ“’ Announcements and I'm not being affected by announced changes.

Bug description

I encountered an issue where the zsh environment is not loading correctly when starting IntelliJ IDEA. After debugging, I found that the conflict occurred because zimfw was being loaded, preventing IntelliJ IDEA from properly initializing the shell environment.

Steps to reproduce

1.Configured zimfw in ~/.zshrc.
2.Started IntelliJ IDEA, but the zsh environment did not load properly.

Current behavior

Image

Expected behavior

Image

zimfw info

Additional context

I fixed the issue by adding the following code to ensure zimfw only loads correctly when not running in the IntelliJ IDEA environment.
from here

if [ -z "$INTELLIJ_ENVIRONMENT_READER" ]; then 
# zimfw
ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
zstyle ':zim' disable-version-check yes
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc} ]]; then
  source /opt/homebrew/opt/zimfw/share/zimfw.zsh init
fi
source ${ZIM_HOME}/init.zsh
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions