DEV Community

8P Inc.
8P Inc.

Posted on

Kiro Cannot Get Response from The Second Command in The Same Shell

As you may know, when Kiro wants to run shell commands, it opens a new zsh (named "Kiro"), runs the command on that shell, and gets the response to analyze the next step.

Unfortunately, if you're using Kiro, zsh, and powerlevel10k theme in OH-My-Zsh together, you may face this problem like I did.

For the first command sent to the shell, it gets a response successfully. However, for the second command in the same shell, Kiro cannot get the response from the shell command and ends up waiting for a response indefinitely.

This problem is so annoying and made me fed up with Kiro.

Recently, I discovered it's due to the incompatibility between powerlevel10k theme and Kiro. So, I found a way to mitigate this problem, which allows me to give Kiro another shot.

We know that:

  • If zsh is opened by Kiro, the environment variable TERM_PROGRAM equals "kiro"
  • There are 2 personas in Kiro that can open new shells:
    • "Us" as users can use powerlevel10k theme
    • "Kiro" as an IDE can't use powerlevel10k theme

The Mitigation:

Key Concept: We will not use powerlevel10k theme if the zsh is opened by Kiro

  1. In Kiro, add environment variable ENABLE_ZSH_THEME=1 in zsh configuration

    • Edit Kiro settings kiro-settings-1
    • Change this value (terminal.integrated.profiles.osx) kiro-settings-2
    • Add environment variable kiro-settings-3 At this stage, zsh opened by you will have environment variable ENABLE_ZSH_THEME=1, while zsh opened by Kiro will not have ENABLE_ZSH_THEME=1
  2. Configure ~/.zshrc to match the configuration above

    • Add a condition to load powerlevel10k theme zshrc
  3. Test by opening zsh yourself and letting Kiro open it to see the result

Expected Result:

  • zsh opened by Kiro → no powerlevel10k theme
  • zsh opened by You → has powerlevel10k theme

Benefits

  • Kiro commands work reliably without timeouts
  • Preserves your beautiful terminal theme for regular use**
  • Simple, maintainable solution with minimal configuration
  • No need to completely disable powerlevel10k

Top comments (0)