diff --git a/pkg/arvo/lib/hood/drum.hoon b/pkg/arvo/lib/hood/drum.hoon index 39ceb90dbd..1914b69fa3 100644 --- a/pkg/arvo/lib/hood/drum.hoon +++ b/pkg/arvo/lib/hood/drum.hoon @@ -687,10 +687,9 @@ ++ ta-hit :: hear click |= [x=@ud y=@ud] ^+ +> - ?. =(0 y) +> =/ pol=@ud (lent-char:klr (make:klr cad.pom)) - ?: (lth x pol) +>.$ + =? x (lth x pol) pol +>.$(pos.inp (min (sub x pol) (lent buf.say.inp))) :: ++ ta-erl :: hear local error diff --git a/pkg/interface/webterm/Buffer.tsx b/pkg/interface/webterm/Buffer.tsx index 8d5ae2ce76..da4a8e8a6f 100644 --- a/pkg/interface/webterm/Buffer.tsx +++ b/pkg/interface/webterm/Buffer.tsx @@ -90,7 +90,7 @@ const readInput = (term: Terminal, e: string): Belt[] => { if (1 === m) { const c = e.charCodeAt(2) - 32; const r = e.charCodeAt(3) - 32; - belts.push({ hit: { y: term.rows - r, x: c - 1 } }); + belts.push({ hit: { y: r - 1, x: c - 1 } }); } e = e.slice(3); break; diff --git a/pkg/interface/webterm/lib/blit.ts b/pkg/interface/webterm/lib/blit.ts index e98f8fe750..a34e75900b 100644 --- a/pkg/interface/webterm/lib/blit.ts +++ b/pkg/interface/webterm/lib/blit.ts @@ -21,7 +21,7 @@ export const showBlit = (term: Terminal, blit: Blit) => { if (typeof blit.hop === 'number') { out += csi('H', term.rows, blit.hop + 1); } else { - out += csi('H', term.rows - blit.hop.y, blit.hop.x + 1); + out += csi('H', blit.hop.y + 1, blit.hop.x + 1); } out += csi('s'); // save cursor position } else if ('put' in blit) { diff --git a/pkg/urbit/vere/io/term.c b/pkg/urbit/vere/io/term.c index f4039bf8b3..a653a6bcb0 100644 --- a/pkg/urbit/vere/io/term.c +++ b/pkg/urbit/vere/io/term.c @@ -385,7 +385,7 @@ _term_it_clear_line(u3_utty* uty_u) // if we're clearing the bottom line, clear our mirror of it too // - if ( 0 == uty_u->tat_u.mir.rus_w ) { + if ( uty_u->tat_u.siz.row_l - 1 == uty_u->tat_u.mir.rus_w ) { _term_it_free_line(uty_u); } } @@ -401,7 +401,7 @@ _term_it_show_blank(u3_utty* uty_u) /* _term_it_move_cursor(): move cursor to row & column * - * row 0 is at the bottom, col 0 is to the left. + * row 0 is at the top, col 0 is to the left. * if the given position exceeds the known window size, * it is clipped to stay within the window. */ @@ -413,7 +413,7 @@ _term_it_move_cursor(u3_utty* uty_u, c3_w col_w, c3_w row_w) if ( row_w >= row_l ) { row_w = row_l - 1; } if ( col_w >= col_l ) { col_w = col_l - 1; } - _term_it_send_csi(uty_u, 'H', 2, row_l - row_w, col_w + 1); + _term_it_send_csi(uty_u, 'H', 2, row_w + 1, col_w + 1); _term_it_dump_buf(uty_u, &uty_u->ufo_u.suc_u); uty_u->tat_u.mir.rus_w = row_w; @@ -473,7 +473,7 @@ _term_it_restore_line(u3_utty* uty_u) { u3_utat* tat_u = &uty_u->tat_u; - _term_it_send_csi(uty_u, 'H', 2, tat_u->siz.row_l, 0); + _term_it_send_csi(uty_u, 'H', 2, tat_u->siz.row_l, 1); _term_it_dump_buf(uty_u, &uty_u->ufo_u.cel_u); _term_it_send_stub(uty_u, u3k(tat_u->mir.lin)); //NOTE send_stub restores cursor position @@ -490,7 +490,8 @@ _term_it_save_stub(u3_utty* uty_u, u3_noun tub) // keep track of changes to bottom-most line, to aid spinner drawing logic. // -t mode doesn't need this logic, because it doesn't render the spinner. // - if ( (0 == tat_u->mir.rus_w) && (c3n == u3_Host.ops_u.tem)) { + if ( ( tat_u->siz.row_l - 1 == tat_u->mir.rus_w ) && + ( c3n == u3_Host.ops_u.tem ) ) { lin = u3dq("wail:klr:format", lin, tat_u->mir.cus_w, u3k(tub), ' '); lin = u3do("pact:klr:format", lin); } @@ -513,8 +514,8 @@ _term_it_show_nel(u3_utty* uty_u) } uty_u->tat_u.mir.cus_w = 0; - if ( uty_u->tat_u.mir.rus_w > 0 ) { - uty_u->tat_u.mir.rus_w--; + if ( uty_u->tat_u.mir.rus_w < uty_u->tat_u.siz.row_l - 1 ) { + uty_u->tat_u.mir.rus_w++; } else { // newline at bottom of screen, so bottom line is now empty @@ -716,11 +717,9 @@ _term_io_suck_char(u3_utty* uty_u, c3_y cay_y) } else { c3_y row_y = cay_y - 32; - // only acknowledge button 1 presses within our window + // only acknowledge button 1 presses within our known window if ( 1 != tat_u->esc.ton_y && row_y <= tat_u->siz.row_l ) { - _term_io_spit(uty_u, u3nt(c3__hit, - tat_u->esc.col_y - 1, - tat_u->siz.row_l - row_y)); + _term_io_spit(uty_u, u3nt(c3__hit, tat_u->esc.col_y - 1, row_y - 1)); } tat_u->esc.mou = c3n; tat_u->esc.ton_y = tat_u->esc.col_y = 0; @@ -907,8 +906,8 @@ _term_spin_step(u3_utty* uty_u) // if we know where the bottom line is, and the cursor is not on it, // move it to the bottom left // - if ( tat_u->siz.row_l && tat_u->mir.rus_w > 0 ) { - _term_it_send_csi(uty_u, 'H', 2, tat_u->siz.row_l, 0); + if ( tat_u->siz.row_l && tat_u->mir.rus_w < tat_u->siz.row_l - 1 ) { + _term_it_send_csi(uty_u, 'H', 2, tat_u->siz.row_l, 1); } c3_w i_w; @@ -1357,7 +1356,7 @@ _term_ef_blit(u3_utty* uty_u, case c3__hop: { u3_noun pos = u3t(blt); if ( c3y == u3r_ud(pos) ) { - _term_it_move_cursor(uty_u, pos, 0); + _term_it_move_cursor(uty_u, pos, uty_u->tat_u.siz.row_l - 1); } else { _term_it_move_cursor(uty_u, u3h(pos), u3t(pos)); @@ -1369,7 +1368,7 @@ _term_ef_blit(u3_utty* uty_u, } break; case c3__lin: { //TMP backwards compatibility - _term_it_move_cursor(uty_u, 0, 0); + _term_it_move_cursor(uty_u, 0, uty_u->tat_u.siz.row_l - 1); _term_it_clear_line(uty_u); } // case c3__put: {