Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: combining .histfiles

On Oct 14, 2014 3:24 PM, "Ray Andrews" <rayandrews@xxxxxxxxxxx> wrote:
> I could stop the command on each line  individually,  but not the
.histfile *itself*.  Is there some way to
> to break out of it?

As I said, Ctrl+c should do it.  I just now manufactured a file with a few
hundred "cp largefile /dev/null" commands, read it with "." and was able to
end it with Ctrl+c before it made it all the way through.

Of course if the history file contains a command to trap or otherwise
disable tty interrupts, you're stuck once that is reached.  Ctrl+z will
only suspend the current command, not the whole script.

Incidentally the reason the file format is that way is so that it can be
shared with other (non-zsh) shells if desired.  That's probably not very
often desired any more.

It occurs to me that it might be feasible to ensure that the first line of
the history file is always "return 1".  There'd be some potential user
confusion to dispel ("why is my history file 101 lines long when I have
SAVEHIST set to 100?").  On the other hand, you are the first person I've
ever heard of make this particular mistake.  :-) :-/

Messages sorted by: Reverse Date, Date, Thread, Author