Skip to content

Commit bf4ae00

Browse files
committed
🎁 Add _parseKeyValueAssignment helper method
Signed-off-by: Babak K. Shandiz <[email protected]>
1 parent f86e19e commit bf4ae00

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,4 +429,14 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
429429
}
430430
return result;
431431
}
432+
433+
private _parseKeyValueAssignment(message: string): { key: string; value: string | undefined } {
434+
const [key, ...rawValues] = message.split('=');
435+
if (!rawValues.length) {
436+
return { key, value: undefined }; // No '=' was found.
437+
}
438+
const rawValue = rawValues.join('=');
439+
const value = this._deserializeMessage(rawValue);
440+
return { key, value };
441+
}
432442
}

0 commit comments

Comments
 (0)