mirror of
https://codeberg.org/TicklishHoneyBee/CLIte.git
synced 2026-03-11 09:04:37 +00:00
fix bug with prompt being written to terminal
This commit is contained in:
parent
b032d45b63
commit
d2ba616d4f
2 changed files with 9 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue