File tree 2 files changed +12
-0
lines changed 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,17 @@ int readline_process_char(int c) {
177
177
vstr_cut_tail_bytes (rl .line , rl .line -> len - rl .cursor_pos );
178
178
// set redraw parameters
179
179
redraw_from_cursor = true;
180
+ #endif
181
+ } else if (c == CHAR_CTRL_L ) {
182
+ // CTRL-L is clear screen / redraw. This specific sequence is used
183
+ // (instead of a slightly more minimal sequence) for compatibility
184
+ // with the built-in Terminal class
185
+ mp_hal_stdout_tx_str ("\x1b[;H\x1b[2J" );
186
+ mp_hal_stdout_tx_str (rl .prompt );
187
+ mp_hal_stdout_tx_strn (rl .line -> buf + rl .orig_line_len , rl .cursor_pos - rl .orig_line_len );
188
+ // set redraw parameters
189
+ redraw_from_cursor = true;
190
+ #if MICROPY_REPL_EMACS_KEYS
180
191
} else if (c == CHAR_CTRL_N ) {
181
192
// CTRL-N is go to next line in history
182
193
goto down_arrow_key ;
Original file line number Diff line number Diff line change 35
35
#define CHAR_CTRL_E (5)
36
36
#define CHAR_CTRL_F (6)
37
37
#define CHAR_CTRL_K (11)
38
+ #define CHAR_CTRL_L (12)
38
39
#define CHAR_CTRL_N (14)
39
40
#define CHAR_CTRL_P (16)
40
41
#define CHAR_CTRL_U (21)
You can’t perform that action at this time.
0 commit comments