diff --git a/clite/core.js b/clite/core.js index 565a5aa..211ad8f 100644 --- a/clite/core.js +++ b/clite/core.js @@ -1,6 +1,6 @@ var clite = { state:{ - version:'0.3-7', + version:'0.3.8', isinit:false, runlevel:1 }, @@ -43,13 +43,13 @@ var clite = { clite.term.setCustom({type:'file',callback:callback}); clite.term.writeLine('open file: '+name); return; - - // fuck it, I'll just update about:config in firefox } fetch(name+'?d='+(new Date).getTime()) - .then(response => response.text()) - .then((data) => { + .then(function(response) { + return response.text(); + }) + .then(function(data) { callback(data); }); } @@ -2260,7 +2260,7 @@ clite.term = { f = document.createElement('form'); f.id = 'form'; f.innerHTML = ''; - if (!clite.term.isalt) { + if (!clite.term.data.isalt) { var l = document.createElement('label'); l.innerHTML = clite.lib.htmlEncode(clite.term.data.prompt); f.appendChild(l); diff --git a/clite/shell.js b/clite/shell.js index 8017243..f258f98 100644 --- a/clite/shell.js +++ b/clite/shell.js @@ -260,10 +260,10 @@ clite.commands.load('sh',function(args,env,io) { } history.add(txt); history.resetCurrent(); - if (interactive) - stdio.write(io.stdout,prompt+txt); // clear the tty prompt term.ttyctrl('prompt',''); + if (interactive) + stdio.write(io.stdout,prompt+txt); // split command line into arguments var args = clite.strToArgs(txt); args.forEach(function(val,i) { @@ -322,6 +322,7 @@ clite.commands.load('sh',function(args,env,io) { stdio.write(io.stderr,'Shell: internal error'); if (interactive) inputRead(); + return; } stdlib.waitpid(pid,inputRead); }