Fixed Windows Clipboard issue with setclip

This commit is contained in:
Bryan Roe 2021-04-22 19:47:05 -07:00
parent a5053b17e5
commit 9aa8691b77

View File

@ -989,12 +989,11 @@ function handleServerCommand(data) {
} }
else else
{ {
var tmp = "require('clipboard')(\"" + data.data.split('"').join('\\"') + '");process.exit();'; var tmp = "require('clipboard')(" + JSON.stringify(data.data) + ');process.exit();';
tmp = Buffer.from(tmp).toString('base64'); tmp = Buffer.from(tmp).toString('base64');
var uid = require('user-sessions').consoleUid(); var uid = require('user-sessions').consoleUid();
var user = require('user-sessions').getUsername(uid);
var domain = require('user-sessions').getDomain(uid); var domain = require('user-sessions').getDomain(uid);
var user = domain + '\\' + require('user-sessions').getUsername(uid);
var taskoptions = { env: { _target: process.execPath, _args: '-b64exec ' + tmp, _user: user } }; var taskoptions = { env: { _target: process.execPath, _args: '-b64exec ' + tmp, _user: user } };
for (var c1e in process.env) for (var c1e in process.env)
{ {