On Mon, Jun 22, 2020 at 07:13:30AM +0100, Jason McIntyre wrote:
> how will people be able to find this if we don;t document it? from a
> brief skim of docs which may hold answers, i still can;t find where
> these values are documented.
Fair point, I removed them because they imply that systat honours
whatever keys control character are bound to, even though it in fact
hardcodes keys such as ^H for character kill and ^G for line kill.

top(1)'s INTERACTIVE MODE section for example ends with

        While typing this information in, the user's erase and kill
        keys (as set up by the command stty(1)) are recognized, and a newline
        terminates the input.

and this indeed correct for top, but systat(1) behaves differently as
can be easily observed when for example binding character kill to @
instead of ^?:

        $ stty erase @
        $ top
        $ systat

Then use any interactive menu and note how in top @ now erases the
last character while backspace prints "^?", whereas in systat @ still
prints "@" and backspace still erase the last character.

> couldn;t we document these work and what the defaults are? it seems
> handy.
Here's an updated diff that adds ^U (default control character for line
kill), documents the two hardcoded keys as such while removing the lie
about unimplemented word kill.

Is that any better?


Index: engine.c
===================================================================
RCS file: /cvs/src/usr.bin/systat/engine.c,v
retrieving revision 1.25
diff -u -p -r1.25 engine.c
--- engine.c    12 Jan 2020 20:51:08 -0000      1.25
+++ engine.c    22 Jun 2020 13:39:51 -0000
@@ -1204,6 +1204,7 @@ cmd_keyboard(int ch)
                break;
        case 0x1b:
        case CTRL_G:
+       case CTRL_U:
                if (cmd_len > 0) {
                        cmdbuf[0] = '\0';
                        cmd_len = 0;
Index: engine.h
===================================================================
RCS file: /cvs/src/usr.bin/systat/engine.h,v
retrieving revision 1.12
diff -u -p -r1.12 engine.h
--- engine.h    12 Jan 2020 20:51:08 -0000      1.12
+++ engine.h    22 Jun 2020 13:39:52 -0000
@@ -36,6 +36,7 @@
 #define CTRL_L  12
 #define CTRL_N  14
 #define CTRL_P  16
+#define CTRL_U  21
 #define CTRL_V  22
 
 #define META_V  246
Index: systat.1
===================================================================
RCS file: /cvs/src/usr.bin/systat/systat.1,v
retrieving revision 1.119
diff -u -p -r1.119 systat.1
--- systat.1    22 Jun 2020 13:17:54 -0000      1.119
+++ systat.1    23 Jun 2020 00:26:43 -0000
@@ -173,7 +173,7 @@ These are:
 Move the cursor to the command line and interpret the input
 line typed as a command.
 While entering a command the
-current character erase, word erase, and line kill characters
+character erase (^H) and line kill (^U) characters
 may be used.
 .It Ic o
 Select the next ordering which sorts the rows according to a

Reply via email to