Skip to content

Feature Request: Hook stdout option to write to TTY for terminal control #6217

@pathammer

Description

@pathammer

Kiro Product

CLI

Feature Description

Hooks currently run in isolated subprocesses with stdout captured silently. This prevents terminal escape sequences from reaching the TTY, making it impossible to control terminal features like iTerm2 tab colors/titles from hooks.

Add a tty: true option that writes hook stdout directly to the parent terminal:

{
 "userPromptSubmit": [{
   "command": "echo -ne \"\\033]0;🪨 Working...\\007\"",
   "tty": true
 }]
}

Use Case

I run an orchestrator agent that spawns long-running subagents for complex tasks. I want to glance at terminal tabs and instantly see status:

  • Amber tab + task snippet = working (e.g., "🪨 deploy lambda...")
  • Green tab = done

With userPromptSubmit hook + tty: true, I could set the tab title to show the first 30 chars of my prompt. With stop hook, I could reset to green.

Current workaround uses iTerm2 Triggers matching Kiro's printed output (Invoking .*subagent, ↳ done), but this can't customize tab titles with dynamic content like the prompt text.

Additional Context

Attempted solutions that don't work:

  • Direct escape sequences in hook command - stdout captured
  • Redirect to /dev/tty - subprocess lacks TTY access
  • osascript/iTerm2 Python API - requires permissions, complex setup

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions