[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enhancement merge request

From: Chet Ramey
Subject: Re: enhancement merge request
Date: Mon, 19 Apr 2021 10:13:48 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1

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    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]