top: enable recall of previous input lines for re-edit

With this commit, users can now retrieve previous line
input for re-editing and/or re-input using the Up/Down
arrow keys (or their aliases). This mirrors the 'bash'
or 'less' interface and represents a major enhancement
achieved via a somewhat minor impact to our code base.

[ 33 lines of code, 5 closing braces & some comments ]
[ all in 1 function, when TERMIOS_ONLY isn't defined ]

Currently, the upper limit for such recallable strings
has been set at 50 but that could be easily increased.

(everything is perfectly justified plus right margins)
(are completely filled, but of course it must be luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2013-02-15 00:00:00 -06:00
committed by Craig Small
parent 477b10c0bd
commit 2efe275512
3 changed files with 75 additions and 12 deletions

View File

@@ -600,6 +600,9 @@ typedef struct WIN_t {
#if (LRGBUFSIZ < SCREENMAX)
# error 'LRGBUFSIZ' must NOT be less than 'SCREENMAX'
#endif
#if defined(TERMIOS_ONLY)
# warning 'TERMIOS_ONLY' disables input recall and makes man doc incorrect
#endif
/*###### Some Prototypes (ha!) #########################################*/