feat(daemon): zsh OSC 133 shell integration via per-surface ZDOTDIR
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# spacesh zsh OSC 133 integration. Sourced from a per-surface ZDOTDIR .zshrc
|
||||
# after the user's ~/.zshrc. Emits semantic-prompt markers so the daemon can
|
||||
# detect command start/end and exit status.
|
||||
autoload -Uz add-zsh-hook 2>/dev/null
|
||||
|
||||
_spacesh_precmd() {
|
||||
local code=$?
|
||||
# End previous command (D) with its exit code, then mark prompt start (A).
|
||||
print -n "\e]133;D;${code}\a\e]133;A\a"
|
||||
}
|
||||
_spacesh_preexec() {
|
||||
# Command output begins (C).
|
||||
print -n "\e]133;C\a"
|
||||
}
|
||||
add-zsh-hook precmd _spacesh_precmd 2>/dev/null
|
||||
add-zsh-hook preexec _spacesh_preexec 2>/dev/null
|
||||
Reference in New Issue
Block a user