Fri, 02 Nov 2018 15:38:17 +0000 Tinker <t1...@protonmail.ch> > On Friday, November 2, 2018 9:11 PM, Klemens Nanni <k...@openbsd.org> wrote: > > On Fri, Nov 02, 2018 at 11:03:34AM +0000, Tinker wrote: > > > > > Could some other ^ shortcut be an ignore-this-line-from-history marker? > > > > I'm inclined to say no; HISTCONTROL=ignorespace works fine and adding > > yet another way to do achieve the same only to compensate user errors > > is out of scope here. > > > > > ^I as in ignore, "bind -m '^L'=^U^Iclear'^J^Y'" :) > > > > ^I is tab, see `complete-list' under "Emacs editing mode" in ksh(1). > > Unimportant, only for completeness to round up, > > I just meant: using "space prefix" as "ignore from history marker" > overlaps with any other use of space prefix, such as when pasting a > script with indentation.
Hi Tinker, Very obvious: if you don't want the 'ignorespace' effect for lines with leading spaces, remove these in the commands to record them in history. > Meaning using space prefix can make things not register in the shell > history, that you thought would. This would lead to someone's surprise > that they are tapping arrow-up/down and can't find what they looked > for, or, that someone thought they'd have a disk recording of their > shell pastes and other interaction and what they get is partial data, > that's all. Exactly, see previous comment & read carefully the manual page section: https://man.openbsd.org/ksh#HISTCONTROL I use these bindings and history control options in the $HOME/.profile: bind -m '^L'=^U\ clear'^J^Y' bind -m '^[^L'=^U\ reset\;clear'^J^Y' export HISTCONTROL=ignoredups:ignorespace They work as expected. You don't just paste commands in the terminal.. First, carefully inspect them in a text editor for safety & correctness or make scripts from them. You will save yourself nasty paste mishaps. Kind regards, Anton Lazarov > Using a ignore marker that unlike space prefix doesn't overlap, would > provide a symmetrical, coherent experience, but again this is truly > unimportant. > > I thought ^-something could be neat if a script file cannot trig it, > have not studied that. I see that ^I was taken already. > > Thanks, > Tinker >