generated from nhcarrigan/template
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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user