feat: display ConfigChange hook events in terminal

Detects [ConfigChange Hook] lines in stderr and emits them as
config-change line type with [config] prefix in purple.

Closes #151
This commit is contained in:
2026-02-24 18:07:53 -08:00
committed by Naomi Carrigan
parent 54280b3920
commit 5063a4f415
5 changed files with 37 additions and 11 deletions
+11 -8
View File
@@ -761,18 +761,21 @@ fn handle_stderr(
}
}
// Worktree hook events are informational — emit with a distinct type
let is_worktree_event = line.contains("[WorktreeCreate Hook]")
|| line.contains("[WorktreeRemove Hook]");
// Hook events are informational — emit with distinct types instead of error
let line_type = if line.contains("[WorktreeCreate Hook]")
|| line.contains("[WorktreeRemove Hook]")
{
"worktree"
} else if line.contains("[ConfigChange Hook]") {
"config-change"
} else {
"error"
};
let _ = app.emit(
"claude:output",
OutputEvent {
line_type: if is_worktree_event {
"worktree".to_string()
} else {
"error".to_string()
},
line_type: line_type.to_string(),
content: line,
tool_name: None,
conversation_id: conversation_id.clone(),