Skip to content

Commit

Permalink
Fix clearing screen in REPL with Ctrl-L
Browse files Browse the repository at this point in the history
saghul committed Sep 25, 2024
1 parent aefdee7 commit 946d653
Showing 2 changed files with 2,554 additions and 2,539 deletions.
5,087 changes: 2,548 additions & 2,539 deletions gen/repl.c

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions repl.js
Original file line number Diff line number Diff line change
@@ -412,6 +412,11 @@ import * as bjson from "bjson";
cursor_pos = skip_word_backward(cursor_pos);
}

function clear_screen() {
directives["clear"]();
return -2;
}

function accept_line() {
std.puts("\n");
history_add(cmd);
@@ -770,6 +775,7 @@ import * as bjson from "bjson";
"\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 */

0 comments on commit 946d653

Please sign in to comment.