Fix for #3026, when terminal command is set to an empty string.

This commit is contained in:
Ylian Saint-Hilaire 2021-08-22 12:06:02 -07:00
parent 3c09f15881
commit 41f70d52dc

View File

@ -1986,15 +1986,17 @@ function onTunnelData(data) {
else if (bash) {
var p = childProcess.execFile(bash, ['bash'], options); // Start bash
// Spaces at the beginning of lines are needed to hide commands from the command history
if ((obj.serverInfo.termlaunchcommand != null) && (typeof obj.serverInfo.termlaunchcommand[process.platform] == 'string')) { p.stdin.write(obj.serverInfo.termlaunchcommand[process.platform]); }
else if (process.platform == 'linux') { p.stdin.write(' alias ls=\'ls --color=auto\';clear\n'); }
if ((obj.serverInfo.termlaunchcommand != null) && (typeof obj.serverInfo.termlaunchcommand[process.platform] == 'string')) {
if (obj.serverInfo.termlaunchcommand[process.platform] != "") { p.stdin.write(obj.serverInfo.termlaunchcommand[process.platform]); }
} else if (process.platform == 'linux') { p.stdin.write(' alias ls=\'ls --color=auto\';clear\n'); }
this.httprequest.connectionPromise._res(p);
}
else if (sh) {
var p = childProcess.execFile(sh, ['sh'], options); // Start sh
// Spaces at the beginning of lines are needed to hide commands from the command history
if ((obj.serverInfo.termlaunchcommand != null) && (typeof obj.serverInfo.termlaunchcommand[process.platform] == 'string')) { p.stdin.write(obj.serverInfo.termlaunchcommand[process.platform]); }
else if (process.platform == 'linux') { p.stdin.write(' alias ls=\'ls --color=auto\';clear\n'); }
if ((obj.serverInfo.termlaunchcommand != null) && (typeof obj.serverInfo.termlaunchcommand[process.platform] == 'string')) {
if (obj.serverInfo.termlaunchcommand[process.platform] != "") { p.stdin.write(obj.serverInfo.termlaunchcommand[process.platform]); }
} else if (process.platform == 'linux') { p.stdin.write(' alias ls=\'ls --color=auto\';clear\n'); }
this.httprequest.connectionPromise._res(p);
}
else {