1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 15:53:55 +00:00

Added default value of ':0' if $DISPLAY is not set

This commit is contained in:
Bryan Roe
2019-01-23 18:42:42 -08:00
parent 74d8bd9aac
commit cf856b0d1d

View File

@@ -653,7 +653,7 @@ function UserSessions()
}
this.consoleUid = function consoleUid()
{
var checkstr = process.platform == 'darwin' ? 'console' : process.env['DISPLAY'];
var checkstr = process.platform == 'darwin' ? 'console' : ((process.env['DISPLAY'])?process.env['DISPLAY']:':0')
var child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = '';
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });