Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14247 > unrolled thread

Re: history shows edited lines not the lines actually ran

Started byChet Ramey <chet.ramey@case.edu>
First post2018-06-18 09:29 -0400
Last post2018-06-18 09:29 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: history shows edited lines not the lines actually ran Chet Ramey <chet.ramey@case.edu> - 2018-06-18 09:29 -0400

#14247 — Re: history shows edited lines not the lines actually ran

FromChet Ramey <chet.ramey@case.edu>
Date2018-06-18 09:29 -0400
SubjectRe: history shows edited lines not the lines actually ran
Message-ID<mailman.2185.1529328621.1292.bug-bash@gnu.org>
On 6/16/18 1:23 PM, kermit@new.rednsx.org wrote:

> Bash Version: 4.2
> Patch Level: 46
> Release Status: release
> 
> Description:
> 	when you edit a line from your bash history, history shows the edited version, even if you never ran it

Yes. Each in-memory history entry can be edited aribitrarily, and each has
an individual list of changes to undo (if you see an asterisk preceding a
history entry when you list the history lines, it means the line has been
modified). When you execute a modified history line, readline reverts the
line to its original state by unwinding the changes. You can set the
`revert-all-at-newline' variable to force readline to undo all  changes to
modified history lines whenever it reads a newline and returns.

By default, the history library writes the contents of the in-memory
history list to the history file, including modified lines. If you don't
want this, set `revert-all-at-newline'.

-- 
``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/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web