SIGTERM is now a thing but there's no use of it

This commit is contained in:
minjaesong
2021-04-23 14:24:15 +09:00
parent 6902cb27ec
commit 04cafea3c5
3 changed files with 43 additions and 14 deletions

View File

@@ -386,7 +386,7 @@ shell.execute = function(line) {
sendLcdMsg(_G.shellProgramTitles[_G.shellProgramTitles.length - 1]);
//serial.println(_G.shellProgramTitles);
return (ret == undefined) ? 0 : ret;
return ret;
}
}
}
@@ -457,8 +457,14 @@ if (goInteractive) {
try {
errorlevel = 0; // reset the number
errorlevel = shell.execute(cmdbuf);
//if (isNaN(errorlevel)) errorlevel = 2;
serial.printerr(`errorlevel: ${errorlevel}`);
let rawE = errorlevel;
if (errorlevel instanceof SIG)
errorlevel = errorlevel.name;
else if (errorlevel == undefined || (typeof errorlevel.trim == "function" && errorlevel.trim().length == 0) || isNaN(errorlevel))
errorlevel = 0;
serial.printerr(`errorlevel: ${errorlevel} (raw: ${rawE})`);
}
catch (e) {
printerrln("\n"+(e.stack || e));