zsh-workers
 help / color / mirror / code / Atom feed
* [BUG] Trailing backslash in history file confuses entries
@ 2021-11-09 22:46 Leah Neukirchen
  2021-11-24 23:04 ` Oliver Kiddle
  0 siblings, 1 reply; 2+ messages in thread
From: Leah Neukirchen @ 2021-11-09 22:46 UTC (permalink / raw)
  To: zsh-workers

Hi,

I noticed this weird behavior:

% zsh --version
zsh 5.8 (x86_64-unknown-linux-gnu)
% zsh -f
rhea% SAVEHIST=9000 HISTSIZE=9000 HISTFILE=/tmp/.zsh_history 
rhea% setopt INC_APPEND_HISTORY EXTENDED_HISTORY
rhea% less foo\<RET><C-c>   # this saves a line with final \ to .zsh_history
rhea% echo bar
bar
rhea% <C-c>
% zsh -f
rhea% SAVEHIST=9000 HISTSIZE=9000 HISTFILE=/tmp/.zsh_history
rhea% fc -R   # load history, same happens without zsh -f by default...
rhea% <UP>
rhea% less foo
: 1636497381:0;echo bar
<C-c>
% tail -n2 /tmp/.zsh_history 
: 1636497373:0;less foo\
: 1636497381:0;echo bar

As you can see, zsh parses the trailing backslash as a line
continuation and assumes the two lines were entered at once
(EXTENDED_HISTORY increases the confusion of the user here).
I assume some kind of escaping has been forgotten in this case.

Thanks,
-- 
Leah Neukirchen  <leah@vuxu.org>  https://leahneukirchen.org/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-24 23:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 22:46 [BUG] Trailing backslash in history file confuses entries Leah Neukirchen
2021-11-24 23:04 ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).