From c1b5ff3b236678087d740d6eb353df357421834c Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Thu, 18 Jan 2024 22:50:45 +0000 Subject: [PATCH] fix mac clipboard missing end 2 characters (#211) --- modules/message-box.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/message-box.js b/modules/message-box.js index 4e222682..b7fb9bb0 100644 --- a/modules/message-box.js +++ b/modules/message-box.js @@ -953,7 +953,7 @@ function macos_messageBox() ret.child.on('exit', function () { var res = this.stdout.str.split('\x1e')[1]; - if (res.length > 2) { res = res.substring(0, res.length - 2); } + // if (res.length > 2) { res = res.substring(0, res.length - 2); } this.promise._res(res); }); ret.child.stdin.write('su - ' + ret.name + '\n'); @@ -1130,7 +1130,7 @@ function macos_messageBox() } else { - if (this._shell.stdout.str.length > 2) { this._shell.stdout.str = this._shell.stdout.str.substring(0, this._shell.stdout.str.length - 2); } + // if (this._shell.stdout.str.length > 2) { this._shell.stdout.str = this._shell.stdout.str.substring(0, this._shell.stdout.str.length - 2); } this.end(translateObject({ command: 'readClip', clipValue: this._shell.stdout.str })); } break;