Skip to content

Commit

Permalink
Add validation for debug session status
Browse files Browse the repository at this point in the history
  • Loading branch information
radurentea committed Oct 23, 2024
1 parent b34d8e9 commit 9c7161d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/espIdf/monitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import { ESP } from "../../config";
import { appendIdfAndToolsToPath, getUserShell } from "../../utils";
import { window, Terminal, Uri, env } from "vscode";
import { window, Terminal, Uri, env, debug } from "vscode";

export interface MonitorConfig {
baudRate: string;
Expand Down Expand Up @@ -97,7 +97,10 @@ export class IDFMonitor {
"--toolchain-prefix",
this.config.toolchainPrefix,
];
if (this.config.noReset && this.config.idfVersion >= "5.0") {
if (
this.isDebugSessionActive() ||

Check failure on line 101 in src/espIdf/monitor/index.ts

View workflow job for this annotation

GitHub Actions / extension_ci

Property 'isDebugSessionActive' does not exist on type 'typeof IDFMonitor'.
(this.config.noReset && this.config.idfVersion >= "5.0")
) {
args.splice(2, 0, "--no-reset");
}
if (this.config.enableTimestamps && this.config.idfVersion >= "4.4") {
Expand Down Expand Up @@ -144,4 +147,8 @@ export class IDFMonitor {
this.terminal.sendText(`exit`);
} catch (error) {}
}

private isDebugSessionActive(): boolean {
return debug.activeDebugSession !== undefined;
}
}

0 comments on commit 9c7161d

Please sign in to comment.