MCPcopy Index your code
hub / github.com/codeaashu/claude-code / sendToChannel

Function sendToChannel

src/services/notifier.ts:40–75  ·  view source on GitHub ↗
(
  channel: string,
  opts: NotificationOptions,
  terminal: TerminalNotification,
)

Source from the content-addressed store, hash-verified

38const DEFAULT_TITLE = 'Claude Code'
39
40async function sendToChannel(
41 channel: string,
42 opts: NotificationOptions,
43 terminal: TerminalNotification,
44): Promise<string> {
45 const title = opts.title || DEFAULT_TITLE
46
47 try {
48 switch (channel) {
49 case 'auto':
50 return sendAuto(opts, terminal)
51 case 'iterm2':
52 terminal.notifyITerm2(opts)
53 return 'iterm2'
54 case 'iterm2_with_bell':
55 terminal.notifyITerm2(opts)
56 terminal.notifyBell()
57 return 'iterm2_with_bell'
58 case 'kitty':
59 terminal.notifyKitty({ ...opts, title, id: generateKittyId() })
60 return 'kitty'
61 case 'ghostty':
62 terminal.notifyGhostty({ ...opts, title })
63 return 'ghostty'
64 case 'terminal_bell':
65 terminal.notifyBell()
66 return 'terminal_bell'
67 case 'notifications_disabled':
68 return 'disabled'
69 default:
70 return 'none'
71 }
72 } catch {
73 return 'error'
74 }
75}
76
77async function sendAuto(
78 opts: NotificationOptions,

Callers 1

sendNotificationFunction · 0.85

Calls 2

sendAutoFunction · 0.85
generateKittyIdFunction · 0.85

Tested by

no test coverage detected