How to fix Terminal Integration Freezing in AI-enabled IDEs (kiro, vscode)?
Why do we need terminal integration?
Most AI-enabled IDEs use terminal integration to run commands and get the output back in the IDE. This is useful for fully automated tasks, such as running tests, building projects, and more. In some cases, you can do this manually in an external terminal, but you will lose some of the IDE’s automation capabilities.
Be aware!
Blindly trusting AI is dangerous! There have already been cases where AI followed malicious instructions and caused harm. Always check the list of allowed commands for automatic execution, and try to run your IDE in a sandbox to prevent access to unrelated data.
Why can terminal integration freeze?
In most cases, the problem is that using complicated and slow zsh themes (like oh-my-zsh with powerlevel10k) makes the terminal startup too slow, causing the IDE’s terminal integration to time out while waiting for the shell to be ready. Additionally, some themes use special characters that are not properly handled by the IDE terminal.
How to fix it?
Disable the theme. You can do this by editing your ~/.zshrc
file and setting the theme to empty (“”), which will disable it and improve terminal startup time.
1 | if [[ "$TERM_PROGRAM" == "kiro" || "$TERM_PROGRAM" == "vscode" ]]; then |
This code checks if the terminal is running inside Kiro or VSCode, and if so, it disables the theme. Otherwise, it uses the powerlevel10k theme.