Skip to content

[kiro-cli] /editor command hangs in TUI mode (works in --classic mode) #7172

@boday

Description

@boday

Before opening, please confirm:

Operating System

macOS 26.1 (Sequoia), Apple M1 Pro

Kiro Version

1.29.3 (kiro-cli)

Bug Description

The /editor slash command hangs indefinitely when running kiro-cli in the new TUI mode (default). The terminal becomes unresponsive after invoking /editor, requiring a force kill (Ctrl+C or closing the terminal).

The same /editor command works correctly in --classic mode (kiro-cli --classic).

Environment:

  • EDITOR=nano (GNU nano 8.7.1)
  • TERM=xterm-256color
  • TERM_PROGRAM=iTerm.app
  • LANG=zh_TW.UTF-8

Suspected cause: The TUI mode may not properly release stdin/stdout control to the external editor process (nano). This could be related to the Kitty protocol sequence handling that was partially fixed in v1.29.2 ("Fixed Kitty protocol sequence leakage by draining stdin on exit") and v1.29.3 ("Fixed tmux pane title showing 'twinki:c' and APC sequence corruption"). The TUI's terminal sequence management may interfere with nano's ability to take over the terminal.

A similar issue was reported in #3463 (v0.4.0, "Terminal loop when opening terminal editors like nano or git diff"), which was closed without resolution.

Steps to Reproduce

  1. Ensure EDITOR=nano is set in your shell environment
  2. Launch kiro-cli in TUI mode (default): kiro-cli chat
  3. Type /editor and press Enter
  4. The terminal hangs — nano does not open, no editor UI appears, input is frozen

Workaround that works:

  1. Launch kiro-cli in classic mode: kiro-cli --classic
  2. Type /editor and press Enter
  3. nano opens correctly, content can be edited and submitted

Expected Behavior

When /editor is invoked in TUI mode, kiro-cli should:

  1. Properly suspend the TUI and release terminal control (stdin/stdout)
  2. Launch the configured $EDITOR (nano) with a temporary .md file
  3. Wait for the editor to close
  4. Read the content and send it as a prompt
  5. Restore the TUI interface

This is the behavior observed in --classic mode, which works correctly.

Conversation ID

No response

Additional Context

  • v1.29.2 changelog mentions: "Fixed Kitty protocol sequence leakage by draining stdin on exit" — suggests TUI stdin handling is a known area of concern
  • v1.29.3 changelog mentions: "Fixed tmux pane title showing 'twinki:c' and APC sequence corruption" — terminal escape sequence issues in TUI
  • Previous related issue: Terminal loop #3463 (v0.4.0, macOS, "Kiro stays in the loop when it opens terminal editors like nano or git diff")
  • EDITOR="code --wait" (VS Code) may work as a workaround since it doesn't need terminal control, but terminal-based editors (nano, vim) are expected to work

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions