Change the default command prompts

This commit is contained in:
Justine Tunney 2022-04-06 06:56:11 -07:00
parent ce9bdbb0bf
commit 82f2e758c7
6 changed files with 18 additions and 9 deletions

View file

@ -510,6 +510,9 @@ int lre_parse_escape(const uint8_t **pp, int allow_utf16)
case 'f':
c = '\f';
break;
case 'e':
c = '\e'; /* [jart] love this */
break;
case 'n':
c = '\n';
break;

View file

@ -111,9 +111,9 @@ import * as os from "os";
var plen = 0;
var ps1;
if (config_numcalc)
ps1 = "> ";
ps1 = ">: ";
else
ps1 = "qjs > ";
ps1 = "qjs >: ";
var ps2 = " ... ";
var utf8 = true;
var show_time = false;
@ -547,6 +547,11 @@ import * as os from "os";
this_fun = kill_region;
}
function clear_screen() {
std.puts("\e[H\e[2J");
return -1;
}
function kill_line() {
kill_region(cursor_pos, cmd.length, 1);
}
@ -743,6 +748,7 @@ import * as os from "os";
"\x09": completion, /* ^I - history-search-backward */
"\x0a": accept_line, /* ^J - newline */
"\x0b": kill_line, /* ^K - delete to end of line */
"\x0c": clear_screen, /* ^L - clear screen */
"\x0d": accept_line, /* ^M - enter */
"\x0e": next_history, /* ^N - down */
"\x10": previous_history, /* ^P - up */