Feature: Emit OSC 133 shell integration sequences for terminal prompt jumping
Resolved 💬 3 comments Opened Feb 2, 2026 by devenv Closed Feb 6, 2026
Summary
Modern terminals (Ghostty, iTerm2, Kitty, WezTerm) support semantic shell integration via OSC 133 sequences. This enables:
- Jumping between prompts (e.g., Ctrl+Shift+J/K in Ghostty)
- Selecting entire command output with a single click
- Scrolling to previous/next prompt
- Better terminal UI integration overall
Request
Could Claude Code emit these sequences around its REPL prompt?
\e]133;A\a # Before showing the prompt (marks prompt start)
\e]133;C\a # After user input, before execution (marks command start)
\e]133;D\a # After output completes (marks output end)
Why This Matters
When using Claude Code for extended sessions, the terminal fills with many interactions. Being able to quickly jump between prompts (like you can with shell prompts) would significantly improve navigation.
Reference Implementation
Here's how shells typically implement this (from Ghostty's shell integration):
# Zsh example
_prompt_precmd() { print -n '\e]133;D\a\e]133;A\a' }
_prompt_preexec() { print -n '\e]133;C\a' }
Terminals That Support This
- Ghostty (native)
- iTerm2 (Shell Integration)
- Kitty
- WezTerm
- VS Code integrated terminal
- Windows Terminal
This is becoming a de-facto standard for terminal semantic zones.
Related
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗