Browse Source

terminal: fix some bad cursor visibility

K. Lange 2 years ago
parent
commit
625bdb6f96
3 changed files with 3 additions and 1 deletions
  1. 1 0
      apps/terminal-vga.c
  2. 1 0
      apps/terminal.c
  3. 1 1
      lib/rline_exp.c

+ 1 - 0
apps/terminal-vga.c

@@ -636,6 +636,7 @@ static void cell_redraw_box(uint16_t x, uint16_t y) {
 #endif
 
 void render_cursor() {
+	if (!cursor_on) return;
 	cell_redraw_inverted(csr_x, csr_y);
 }
 

+ 1 - 0
apps/terminal.c

@@ -1108,6 +1108,7 @@ static void cell_redraw_box(uint16_t x, uint16_t y) {
 
 /* Draw the cursor cell */
 static void render_cursor() {
+	if (!cursor_on) return;
 	if (!window->focused) {
 		/* An unfocused terminal should draw an unfilled box. */
 		cell_redraw_box(csr_x, csr_y);

+ 1 - 1
lib/rline_exp.c

@@ -1612,7 +1612,7 @@ int rline_experimental(char * buffer, int buf_size) {
 	the_line = line_create();
 	loading = 0;
 	read_line();
-	printf("\033[0m\n");
+	printf("\033[?25h\033[0m\n");
 
 	unsigned int off = 0;
 	for (int j = 0; j < the_line->actual; j++) {