|
From: | Christer Enfors |
Subject: | Re: filter() prevents clearing of screen, but still clears current line |
Date: | Fri, 16 Mar 2007 15:32:07 +0100 |
User-agent: | Thunderbird 1.5.0.10 (Windows/20070221) |
Thomas Dickey wrote:
On Fri, 16 Mar 2007, Christer Enfors wrote:I've tried this now, but it still seems to clear the entire current line before displaying my field. I don't want it to clear anything, only display the field.I see (partly). What is on the line that you want to keep?
Well, I basically have two programs - outstring (which is a script that uses printf and tput as per your suggestion earlier), which for instance could be called like this (-r for row, -c for column):
$ outstring -r 1 -c 1 "Continue (Y/n)?" Or more frequently, like this:$ outstring -h "(Heading)" -r 3 -c 0 "Proceed with backup (Y/n)?" -r 5 -c 0 "Background or interactive (B/i)?"
In other words, outstring is called (from a bunch of legacy scripts) to diplay a form. After that, instring, which I'm now working on is called in a similar manner to diplay (and read the input from) an input field, so the user can choose "y" or "n" or whatever. Instring returns different exit codes depending on what the user does - arrow keys up and down for example, return exit values that tell the legacy script "time to call instring again, only this time on a different part of the screen depending on which arrow key is pressed". Hence, it is possible to navigate between multiple input fields even though in reality there is only one input field on the screen at a time.
Anyway, the point is that the input field will typically be displayed after a string printed by outstring (on the same row), such as "Continue (Y/n)?". So instring erases the current line (and therefore also the "continue" prompt). Not good.
-- Christer Enfors
[Prev in Thread] | Current Thread | [Next in Thread] |