Skip to content

Commit 1c134a9

Browse files
Micro66hongyu9
authored andcommitted
fix: 保护JETBRAINS_INTELLIJ_ZSH_DIR环境变量避免被清除
1 parent f1ee6ee commit 1c134a9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

jetbrains_plugin/src/main/kotlin/com/sina/weibo/agent/terminal/WeCoderTerminalCustomizer.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,14 @@ class WeCoderTerminalCustomizer : LocalTerminalCustomizer() {
168168
val userZdotdir = envs["ZDOTDIR"]
169169
?: System.getenv("ZDOTDIR")
170170
?: System.getProperty("user.home")
171-
171+
172+
// 🔧 Protect the JETBRAINS_INTELLIJ_ZSH_DIR environment variable to prevent it from being cleared.
173+
val jetbrainsZshDir = envs["JETBRAINS_INTELLIJ_ZSH_DIR"] ?: System.getenv("JETBRAINS_INTELLIJ_ZSH_DIR")
174+
if (jetbrainsZshDir != null) {
175+
envs["JETBRAINS_INTELLIJ_ZSH_DIR"] = jetbrainsZshDir
176+
logger.info("🔧 Preserved JETBRAINS_INTELLIJ_ZSH_DIR: $jetbrainsZshDir")
177+
}
178+
172179
envs["USER_ZDOTDIR"] = userZdotdir
173180
envs["ZDOTDIR"] = scriptPath
174181

0 commit comments

Comments
 (0)