Browse Source

Steal an idea from fish to handle output without a trailing linefeed

K. Lange 4 years ago
parent
commit
cc4baaff0d
1 changed files with 5 additions and 0 deletions
  1. 5 0
      lib/rline_exp.c

+ 5 - 0
lib/rline_exp.c

@@ -1395,6 +1395,11 @@ static int read_line(void) {
 	int this_buf[20];
 	uint32_t istate = 0;
 
+	set_colors(COLOR_ALT_FG, COLOR_ALT_BG);
+	fprintf(stdout, "^M\033[0m");
+	for (int i = 0; i < width + prompt_right_width - 2; ++i) {
+		fprintf(stdout, " ");
+	}
 	render_line();
 	place_cursor_actual();