From 97540ed6380421d07d0a45dac9a21b397927a111 Mon Sep 17 00:00:00 2001 From: fang Date: Wed, 28 Apr 2021 16:45:55 +0200 Subject: [PATCH] various: comments, clean-up --- pkg/arvo/lib/hood/drum.hoon | 6 ++--- .../urbit-king/lib/Urbit/Vere/Term/Render.hs | 4 +--- pkg/interface/src/views/apps/term/app.tsx | 1 - pkg/urbit/vere/io/http.c | 4 ++-- pkg/urbit/vere/io/term.c | 23 +++++++------------ 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/pkg/arvo/lib/hood/drum.hoon b/pkg/arvo/lib/hood/drum.hoon index 50d4f7131..8cc908607 100644 --- a/pkg/arvo/lib/hood/drum.hoon +++ b/pkg/arvo/lib/hood/drum.hoon @@ -676,9 +676,9 @@ |= lin=(pair @ud stub) ^+ +> ?: =(mir lin) +> - %+ se-blit(mir lin) %mor - ?: =(q.mir q.lin) [%hop p.lin]~ - [[%hop 0] [%wyp ~] [%klr q.lin] [%hop p.lin] ~] + %- se-blit(mir lin) + ?: =(q.mir q.lin) [%hop p.lin] + mor+[[%hop 0] [%wyp ~] [%klr q.lin] [%hop p.lin] ~] :: ++ se-just :: adjusted buffer |= [pom=stub lin=(pair @ud (list @c))] diff --git a/pkg/hs/urbit-king/lib/Urbit/Vere/Term/Render.hs b/pkg/hs/urbit-king/lib/Urbit/Vere/Term/Render.hs index 853ca953c..1ebb990d3 100644 --- a/pkg/hs/urbit-king/lib/Urbit/Vere/Term/Render.hs +++ b/pkg/hs/urbit-king/lib/Urbit/Vere/Term/Render.hs @@ -49,11 +49,9 @@ hijack :: MonadIO m => Int -> m () hijack h = liftIO do putCSI 'r' [1, h-1] -- set scroll region to exclude bottom line putCSI 'S' [1] -- scroll up one line - cursorMove (h-2) 0 -- move cursor to empty space --TODO off-by-one? + cursorMove (h-2) 0 -- move cursor to empty space lojack :: MonadIO m => m () lojack = liftIO do putCSI 'r' [] -- reset scroll region cursorRestore -- restory cursor position - ---TODO consider ANSI.setSGR diff --git a/pkg/interface/src/views/apps/term/app.tsx b/pkg/interface/src/views/apps/term/app.tsx index c57b79c42..45074c636 100644 --- a/pkg/interface/src/views/apps/term/app.tsx +++ b/pkg/interface/src/views/apps/term/app.tsx @@ -160,7 +160,6 @@ export default function TermApp(props: TermAppProps) { //TODO could be static function if we pass in Terminal explicitly? const onBlit = useCallback((ses: string, blit: Blit) => { - //TODO if (!sessions[ses]) { console.log('on blit: no such session', ses); return; diff --git a/pkg/urbit/vere/io/http.c b/pkg/urbit/vere/io/http.c index 7d20fe4de..0ace6082e 100644 --- a/pkg/urbit/vere/io/http.c +++ b/pkg/urbit/vere/io/http.c @@ -42,7 +42,7 @@ typedef struct _u3_h2o_serv { void* gen_u; // response generator struct _u3_hcon* hon_u; // connection backlink struct _u3_hreq* nex_u; // next in connection's list - struct _u3_hreq* pre_u; // next in connection's list + struct _u3_hreq* pre_u; // prev in connection's list } u3_hreq; /* u3_hcon: incoming http connection. @@ -57,7 +57,7 @@ typedef struct _u3_h2o_serv { struct _u3_http* htp_u; // server backlink struct _u3_hreq* req_u; // request list struct _u3_hcon* nex_u; // next in server's list - struct _u3_hcon* pre_u; // next in server's list + struct _u3_hcon* pre_u; // prev in server's list } u3_hcon; /* u3_http: http server. diff --git a/pkg/urbit/vere/io/term.c b/pkg/urbit/vere/io/term.c index 10adf75d9..adf2fc3c0 100644 --- a/pkg/urbit/vere/io/term.c +++ b/pkg/urbit/vere/io/term.c @@ -161,6 +161,9 @@ u3_term_log_init(void) // Construct raw termios configuration. // + // makes input available per-character, does not echo input, + // disables special input pre-processing, output post-processing. + // { uty_u->raw_u = uty_u->bak_u; @@ -680,7 +683,6 @@ _term_io_belt(u3_utty* uty_u, u3_noun blb) { u3_ovum* egg_u = _term_ovum_plan(uty_u->car_u, wir, cad); - //REVIEW do we not want even a small delay here? // no spinner delay on %ret // if ( c3__ret == u3h(blb) ) { @@ -772,23 +774,18 @@ _term_io_suck_char(u3_utty* uty_u, c3_y cay_y) // individual characters // else { - if ( (cay_y >= 32) && (cay_y < 127) ) { + if ( (cay_y >= 32) && (cay_y < 127) ) { // visual ascii _term_io_belt(uty_u, u3nt(c3__txt, cay_y, u3_nul)); } - else if ( 0 == cay_y ) { + else if ( 0 == cay_y ) { // null _term_it_dump_buf(uty_u, &uty_u->ufo_u.bel_u); } - else if ( 8 == cay_y || 127 == cay_y ) { + else if ( 8 == cay_y || 127 == cay_y ) { // backspace & delete _term_io_belt(uty_u, u3nc(c3__bac, u3_nul)); } - else if ( 13 == cay_y ) { + else if ( 10 == cay_y || 13 == cay_y ) { // newline & carriage return _term_io_belt(uty_u, u3nc(c3__ret, u3_nul)); } -#if 0 - else if ( 6 == cay_y ) { - _term_io_flow(uty_u); // XX hack - } -#endif else if ( cay_y <= 26 ) { _term_io_belt(uty_u, u3nt(c3__mod, c3__ctl, ('a' + (cay_y - 1)))); } @@ -1655,7 +1652,7 @@ _term_io_talk(u3_auto* car_u) _term_read_cb); } - // XX groace hardcoded terminal number + //TODO reevaluate wrt dill sessions // u3_noun wir = u3nt(c3__term, '1', u3_nul); u3_noun cad; @@ -1667,10 +1664,6 @@ _term_io_talk(u3_auto* car_u) _term_ovum_plan(car_u, u3k(wir), cad); } - // NB, term.c used to also start :dojo - // - // u3nq(c3__flow, c3__seat, c3__dojo, u3_nul) - // refresh terminal state // {