Browse Source

terminal: Fix behavior of newline at right gutter

K. Lange 3 years ago
parent
commit
6c0be3b5fa
2 changed files with 2 additions and 10 deletions
  1. 1 5
      apps/terminal-vga.c
  2. 1 5
      apps/terminal.c

+ 1 - 5
apps/terminal-vga.c

@@ -49,7 +49,6 @@ uint32_t current_bg     = 0;    /* Current background color */
 uint8_t  cursor_on      = 1;    /* Whether or not the cursor should be rendered */
 
 uint8_t  _login_shell   = 0;    /* Whether we're going to display a login shell or not */
-uint8_t  _hold_out      = 0;    /* state indicator on last cell ignore \n */
 
 uint64_t mouse_ticks = 0;
 
@@ -703,16 +702,13 @@ void term_write(char c) {
 		if (csr_x == term_width) {
 			csr_x = 0;
 			++csr_y;
+			if (c == '\n') return;
 		}
 		if (csr_y == term_height) {
 			term_scroll(1);
 			csr_y = term_height - 1;
 		}
 		if (c == '\n') {
-			if (csr_x == 0 && _hold_out) {
-				_hold_out = 0;
-				return;
-			}
 			++csr_y;
 			if (csr_y == term_height) {
 				term_scroll(1);

+ 1 - 5
apps/terminal.c

@@ -109,7 +109,6 @@ static bool _no_frame      = 0;    /* Whether to disable decorations or not */
 static bool _use_aa        = 1;    /* Whether or not to use best-available anti-aliased renderer */
 static bool _have_freetype = 0;    /* Whether freetype is available */
 static bool _force_no_ft   = 0;    /* Whether to force disable the freetype backend */
-static bool _hold_out      = 0;    /* state indicator on last cell ignore \n */
 static bool _free_size     = 1;    /* Disable rounding when resized */
 
 /** Freetype extension renderer functions */
@@ -1268,6 +1267,7 @@ static void term_write(char c) {
 		if (csr_x == term_width) {
 			csr_x = 0;
 			++csr_y;
+			if (c == '\n') return;
 		}
 		if (csr_y == term_height) {
 			save_scrollback();
@@ -1275,10 +1275,6 @@ static void term_write(char c) {
 			csr_y = term_height - 1;
 		}
 		if (c == '\n') {
-			if (csr_x == 0 && _hold_out) {
-				_hold_out = 0;
-				return;
-			}
 			++csr_y;
 			if (csr_y == term_height) {
 				save_scrollback();