Skip to content

Commit df97731

Browse files
committed
2 parents ea7e620 + c61ccd9 commit df97731

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

client/src/extension.ts

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,35 @@ export async function activate(context: ExtensionContext) {
157157

158158

159159
const runSketch = commands.registerCommand('processing.sketch.run', (resource: Uri) => {
160-
if (!resource) {
161-
return;
162-
}
160+
if (!resource) {
161+
return;
162+
}
163163

164-
// Create a new terminal
165-
if (terminal === undefined) {
166-
terminal = window.createTerminal("Sketch");
167-
}
164+
// Create a new terminal
165+
if (terminal === undefined) {
166+
terminal = window.createTerminal("Sketch");
167+
}
168168

169-
// Show the terminal panel
170-
terminal.show(true);
169+
// Show the terminal panel
170+
terminal.show(true);
171171

172-
// Send the command to the terminal
173-
terminal.sendText(`${selectedVersion.path} cli --sketch=${dirname(resource.fsPath)} --run`, true);
172+
// clear the terminal
173+
terminal.sendText("clear", true);
174174

175-
// clear the terminal
176-
terminal.sendText("clear", true);
177-
});
175+
let path = selectedVersion.path;
176+
if (process.platform === "win32") {
177+
// on windows we need to escape spaces
178+
path = `& "${path}"`;
179+
}
180+
181+
// Send the command to the terminal
182+
terminal.sendText(
183+
`${path} cli --sketch=${dirname(
184+
resource.fsPath
185+
)} --run`,
186+
true
187+
);
188+
});
178189

179190
const stopSketch = commands.registerCommand('processing.sketch.stop', () => {
180191
if (terminal === undefined) {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)