Shell: Optimize drawing characters at the end of a command
This commit is contained in:
parent
981c0eb8bc
commit
234051d6bc
|
@ -1064,7 +1064,7 @@ int main(int argc, char** argv)
|
|||
buffers[index].clear();
|
||||
col = 0;
|
||||
break;
|
||||
case '\x04':
|
||||
case '\x04': // ^D
|
||||
fprintf(stdout, "\n");
|
||||
clean_exit();
|
||||
break;
|
||||
|
@ -1086,6 +1086,9 @@ int main(int argc, char** argv)
|
|||
break;
|
||||
default:
|
||||
MUST(buffers[index].insert(ch, col++));
|
||||
if (col == buffers[index].size())
|
||||
fputc(ch, stdout);
|
||||
else
|
||||
fprintf(stdout, "%c\e[s%s\e[u", ch, buffers[index].data() + col);
|
||||
fflush(stdout);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue