Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure args are defined #181941

Closed
wants to merge 13 commits into from
12 changes: 5 additions & 7 deletions src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,12 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
return true;
}
case VSCodeOscPt.CommandLine: {
let commandLine: string;
if (args.length >= 1 || args.length <= 2) {
commandLine = deserializeMessage(args[0]);
} else {
commandLine = '';
const commandLine: string | undefined = args.length ? deserializeMessage(args[0]) : undefined;
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
const isTrusted = args.length > 1 ? args[1] === this._nonce : false;
if (commandLine) {
this._createOrGetCommandDetection(this._terminal).setCommandLine(commandLine, isTrusted);
}
this._createOrGetCommandDetection(this._terminal).setCommandLine(commandLine, args[1] === this._nonce);
return true;
return !!commandLine && args.length < 3;
}
case VSCodeOscPt.ContinuationStart: {
this._createOrGetCommandDetection(this._terminal).handleContinuationStart();
Expand Down