MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / checkCommandForTelemetry

Function checkCommandForTelemetry

frontend/app/view/term/osc-handlers.ts:55–89  ·  view source on GitHub ↗
(decodedCmd: string)

Source from the content-addressed store, hash-verified

53}
54
55function checkCommandForTelemetry(decodedCmd: string) {
56 if (!decodedCmd) {
57 return;
58 }
59
60 const normalizedCmd = normalizeCmd(decodedCmd);
61
62 if (normalizedCmd.startsWith("ssh ")) {
63 recordTEvent("conn:connect", { "conn:conntype": "ssh-manual" });
64 return;
65 }
66
67 const editorsRegex = /^(vim|vi|nano|nvim)\b/;
68 if (editorsRegex.test(normalizedCmd)) {
69 recordTEvent("action:term", { "action:type": "cli-edit" });
70 return;
71 }
72
73 const tailFollowRegex = /(^|\|\s*)tail\s+-[fF]\b/;
74 if (tailFollowRegex.test(normalizedCmd)) {
75 recordTEvent("action:term", { "action:type": "cli-tailf" });
76 return;
77 }
78
79 if (ClaudeCodeRegex.test(normalizedCmd)) {
80 recordTEvent("action:term", { "action:type": "claude" });
81 return;
82 }
83
84 const opencodeRegex = /^opencode\b/;
85 if (opencodeRegex.test(normalizedCmd)) {
86 recordTEvent("action:term", { "action:type": "opencode" });
87 return;
88 }
89}
90
91export function isClaudeCodeCommand(decodedCmd: string): boolean {
92 if (!decodedCmd) {

Callers 1

Calls 2

recordTEventFunction · 0.90
normalizeCmdFunction · 0.85

Tested by

no test coverage detected