Skip to content

Commit

Permalink
Fix truncated diagnostics on Windows (#1082)
Browse files Browse the repository at this point in the history
* We never want to resize the terminal regardless of if
  deployed or debug environment
* If we are using conpty don't put large cols values as it
  will throw an error when task terminal opens
* When we aren't using conpty (debugging) need to set a
  large cols value

Issue: #1074
  • Loading branch information
award999 committed Sep 19, 2024
1 parent 363ec5a commit f527210
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/tasks/SwiftProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,17 @@ export class SwiftPtyProcess implements SwiftProcess {

spawn(): void {
try {
const isWindows = process.platform === "win32";
// The pty process hangs on Windows when debugging the extension if we use conpty
// See https://github.com/microsoft/node-pty/issues/640
const useConpty =
process.platform === "win32" && process.env["VSCODE_DEBUG"] === "1"
? false
: undefined;
const useConpty = isWindows && process.env["VSCODE_DEBUG"] === "1" ? false : true;
this.spawnedProcess = spawn(this.command, this.args, {
cwd: this.options.cwd,
env: { ...process.env, ...this.options.env },
useConpty,
// https://github.com/swiftlang/vscode-swift/issues/1074
// Causing weird truncation issues
cols: !isWindows || useConpty ? undefined : 2147483647, // Max int32
});
this.spawnEmitter.fire();
this.spawnedProcess.onData(data => {
Expand Down Expand Up @@ -136,6 +137,11 @@ export class SwiftPtyProcess implements SwiftProcess {
}

setDimensions(dimensions: vscode.TerminalDimensions): void {
// https://github.com/swiftlang/vscode-swift/issues/1074
// Causing weird truncation issues
if (process.platform === "win32") {
return;
}
this.spawnedProcess?.resize(dimensions.columns, dimensions.rows);
}

Expand Down

0 comments on commit f527210

Please sign in to comment.