Skip to content

Commit

Permalink
Add separate enum for telemetry when running python manually. (micros…
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig authored Sep 23, 2024
1 parent 06a976f commit 14e134e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/client/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2313,7 +2313,7 @@ export interface IEventNamePropertyMapping {
/**
* Whether the user launched the Terminal REPL or Native REPL
*/
replType: 'Terminal' | 'Native';
replType: 'Terminal' | 'Native' | 'manualTerminal';
};
/**
* Telemetry event sent if and when user configure tests command. This command can be trigerred from multiple places in the extension. (Command palette, prompt etc.)
Expand Down
4 changes: 2 additions & 2 deletions src/client/terminals/codeExecution/terminalReplWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { EventName } from '../../telemetry/constants';

function checkREPLCommand(command: string): boolean {
const lower = command.toLowerCase().trimStart();
return lower.startsWith('python') || lower.startsWith('py');
return lower.startsWith('python') || lower.startsWith('py ');
}

export function registerTriggerForTerminalREPL(disposables: Disposable[]): void {
disposables.push(
onDidStartTerminalShellExecution(async (e: TerminalShellExecutionStartEvent) => {
if (e.execution.commandLine.isTrusted && checkREPLCommand(e.execution.commandLine.value)) {
sendTelemetryEvent(EventName.REPL, undefined, { replType: 'Terminal' });
sendTelemetryEvent(EventName.REPL, undefined, { replType: 'manualTerminal' });
}
}),
);
Expand Down

0 comments on commit 14e134e

Please sign in to comment.