Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

xenl like a good terminal should

  • Loading branch information...
commit 23233e2b97687d018ceada9cf3f2a0bcc6560e48 1 parent 8e9ee3d
@klange authored
Showing with 8 additions and 0 deletions.
  1. +1 −0  toaru.terminfo
  2. +7 −0 userspace/terminal.c
View
1  toaru.terminfo
@@ -1,5 +1,6 @@
toaru|toaruos framebuffer terminal,
mc5i,
+ xenl,
cols#128, lines#45,
colors#256, it#8, ncv#18, pairs#32767, npc, am,
ind=^J, cr=^M,
View
7 userspace/terminal.c
@@ -96,6 +96,7 @@ uint8_t _login_shell = 0; /* Whether we're going to display a login shell
uint8_t _use_freetype = 0; /* Whether we should use freetype or not XXX seriously, how about some flags */
uint8_t _unbuffered = 0;
uint8_t _force_kernel = 0;
+uint8_t _hold_out = 0; /* state indicator on last cell ignore \n */
void reinit(); /* Defined way further down */
@@ -1111,6 +1112,10 @@ void term_write(char c) {
c = '?';
}
if (c == '\n') {
+ if (csr_x == 0 && _hold_out) {
+ _hold_out = 0;
+ return;
+ }
csr_x = 0;
++csr_y;
draw_cursor();
@@ -1156,7 +1161,9 @@ void term_write(char c) {
csr_x++;
}
}
+ _hold_out = 0;
if (csr_x == term_width) {
+ _hold_out = 1;
csr_x = 0;
++csr_y;
}
Please sign in to comment.
Something went wrong with that request. Please try again.