]> granicus.if.org Git - procps-ng/commitdiff
top: provide for visual hint when overtype mode active
authorJim Warner <james.warner@comcast.net>
Mon, 13 Jun 2022 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Tue, 14 Jun 2022 11:52:13 +0000 (21:52 +1000)
Given that we won't always be able to alter the cursor
shapes (from underscore to block) if in input overtype
mode, this commit will at least provide a visual clue.

[ while this libvte quirk will impact gnome-terminal ]
[ and likely others, we're able to change the cursor ]
[ shape from underscore to block at a linux console. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c
top/top.h

index b725f68cae0ace85c707f094730b126d544df7ca..962d16a7b828e3fed60ad2e880959fd6ebd57978 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -1330,6 +1330,9 @@ static char *ioline (const char *prompt) {
             break;
       }
       putp(fmtmk("%s%s%s", tg2(beg, Msg_row), Cap_clr_eol, buf));
+#ifdef OVERTYPE_SEE
+      putp(fmtmk("%s%c", tg2(beg - 1, Msg_row), ovt ? '^' : ' '));
+#endif
       putp(tg2(beg+pos, Msg_row));
    } while (key != kbd_ENTER);
 
index 78ecdac041341c306ba714f254fa36a5bcf0271b..b843b511c708c036c22a80e6ebc157446106e12c 100644 (file)
--- a/top/top.h
+++ b/top/top.h
@@ -44,6 +44,7 @@
 //#define OFF_STDERROR            /* disable our stderr buffering (redirect) */
 //#define OFF_STDIOLBF            /* disable our own stdout 'IOFBF' override */
 //#define OFF_XTRAWIDE            /* disable our extra wide multi-byte logic */
+//#define OVERTYPE_SEE            /* display a visual hint for overtype mode */
 //#define PRETEND0NUMA            /* pretend that there ain't any numa nodes */
 //#define PRETEND48CPU            /* pretend we're smp with 48 ticsers (sic) */
 //#define PRETENDNOCAP            /* pretend terminal missing essential caps */