remove % at end of command if no new line
This commit is contained in:
parent
60ad80616b
commit
7cf1d45283
|
@ -74,9 +74,10 @@ async function get_stdin(opt) {
|
||||||
// special key
|
// special key
|
||||||
switch (dom.keyCode) {
|
switch (dom.keyCode) {
|
||||||
case 8:
|
case 8:
|
||||||
if (terminal.buffer.active.cursorX <= startX) return;
|
if (terminal.buffer.active.cursorX <= startX && (!opt.hide)) break;
|
||||||
terminal.write('\b \b');
|
if (!opt.hide) terminal.write('\b \b');
|
||||||
input = input.substring(0, input.length - 1);
|
input = input.substring(0, input.length - 1);
|
||||||
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
break_loop = true;
|
break_loop = true;
|
||||||
terminal.write('\n');
|
terminal.write('\n');
|
||||||
|
@ -155,13 +156,10 @@ async function exec_cmd() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmds[command] != undefined) {
|
if (cmds[command] != undefined) {
|
||||||
const startY = terminal.buffer.normal.cursorY
|
|
||||||
|
|
||||||
|
// execute command
|
||||||
await cmds[command](c.split(' '), terminal, zshapi);
|
await cmds[command](c.split(' '), terminal, zshapi);
|
||||||
|
|
||||||
if (terminal.buffer.active.cursorX != 0 && startY != terminal.buffer.active.cursorY) {
|
|
||||||
terminal.write('\033[30;47m%\033[0m\n');
|
|
||||||
}
|
|
||||||
print_prompt();
|
print_prompt();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue