feat: fix Cursor hook delivery and improve notify workflow
Route hook notifications through /dev/tty and client_tty so OSC reaches Ghostty when Cursor captures stdout. Add afterAgentResponse hook, hook logging, debounce, split test modes, and use directory name for titles. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package hook
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
func decodeJSON(r io.Reader, v any) {
|
||||
if isInteractiveStdin(r) {
|
||||
return
|
||||
}
|
||||
_ = json.NewDecoder(r).Decode(v)
|
||||
}
|
||||
|
||||
func isInteractiveStdin(r io.Reader) bool {
|
||||
file, ok := r.(*os.File)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
if file != os.Stdin {
|
||||
return false
|
||||
}
|
||||
st, err := file.Stat()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return st.Mode()&os.ModeCharDevice != 0
|
||||
}
|
||||
Reference in New Issue
Block a user