How to fix Terminal Integration Freezing in AI-enabled IDEs (kiro, vscode)?

If you're using an AI-enabled IDE like VSCode with the Copilot extension, Kiro IDE, or even Cursor, you might have noticed that the integrated terminal, which is used for some fully automated cases, doesn't always work properly. Command execution looks fine, but the agent doesn't get output from the terminal.

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
2
3
4
5
if [[ "$TERM_PROGRAM" == "kiro" || "$TERM_PROGRAM" == "vscode" ]]; then
ZSH_THEME="" # disable theme for Kiro and VSCode terminals
else
ZSH_THEME="powerlevel10k/powerlevel10k"
fi

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.