powerShell() fix invalid pattern
This commit is contained in:
+5
-5
@@ -423,10 +423,10 @@ function powerShellRelease() {
|
||||
|
||||
function powerShell(cmd) {
|
||||
|
||||
const pattern = [
|
||||
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
||||
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))'
|
||||
].join('|');
|
||||
/// const pattern = [
|
||||
/// '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
||||
/// '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))'
|
||||
/// ].join('|');
|
||||
|
||||
if (_psPersistent) {
|
||||
const id = Math.random().toString(36).substring(2, 12);
|
||||
@@ -472,7 +472,7 @@ function powerShell(cmd) {
|
||||
}
|
||||
if (child && child.pid) {
|
||||
child.stdout.on('data', function (data) {
|
||||
result = result + data.toString('utf8').replace(pattern, '');
|
||||
result = result + data.toString('utf8');
|
||||
});
|
||||
child.stderr.on('data', function () {
|
||||
child.kill();
|
||||
|
||||
Reference in New Issue
Block a user