On 4/18/21 7:12 PM, Ananth Chellappa wrote:
Chet, Lawrence,
         Sincerely appreciate your time. Far as I understand, there is no way to accomplish what I want - concisely : *get a true private mode* (no logging to HISTFILE *OR* recall with history command after exiting private-mode (toggle of history using set -/+ o) *without sacrificing productivity*. That is, when you are *in private mode, you DO WANT recall with !number and arrow keys.

OK, so there are two requirements so far, which can be boiled down to one:

1. Commands continue to be saved in the history list during `private mode'
   and are deleted from the history list when exiting private mode.

The easiest way to do this is to save the history list to a file when
entering private mode and restore it from the file when exiting. You can
do this with a pair of shell functions and an exit trap, depending on how
elaborate you want to be. It's no more of a burden than setting and
unsetting a new option to enable and disable this new behavior.

It's still incompletely specified. For instance, what happens when you run
`history -w' while in `private mode'? Or read new entries from a file using
`history -r'?

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to