> On Apr 19, 2021, at 7:18 AM, Greg Wooledge <g...@wooledge.org> wrote: > > On Mon, Apr 19, 2021 at 01:16:48AM -0400, Grisha Levit wrote: >> I think you can do something similar to the patch directly in the shell by >> temporarily unsetting HISTFILE and then deleting history entries in a >> certain range and restoring HISTFILE when you are ready > > I still think my solution fits the criteria exactly. There was *no* > stated requirement that the "private mode" could not be a separate > shell process.
This wasn't explicitly stated either, but it seems like Ananth wants "private mode" to have access to preceding history. Perhaps something resembling this (with `history -a` instead, if preferred)? private_mode() { history -w bash --rcfile <( echo source ~/.bashrc echo history -r echo unset HISTFILE ) } -- vq