On 2/8/19 2:50 PM, Johannes Hielscher wrote:

> Bash Version: 5.0
> Patch Level: 0
> Release Status: release
> 
> Description:
>         Version 5 of bash comes with the undocumented (?) feature (?)
>         that the command-line editor (edit-and-execute-command) does
>         start not with an empty buffer, but with one that contains the
>         last command.
>       For this function I'd rather invoke `fc`. Consider accidental
>       opening of the editor. You have to actively delete the contents
>       *and save the buffer* in order *not* to execute the last
>       command again (think of some nasty variant of `rm *`, e. g.).
> 
>       If this is a bug (probably introduced by the resolution of
>       http://lists.gnu.org/archive/html/bug-bash/2018-12/msg00043.html ),
>       then it should be fixed. If it is intended behaviour, it should
>       (at least) be announced as such (I found no mention in
>       doc/bash.1, NEWS, or the source files), or (better) be made
>       tunable.

It's a side effect of an issue I addressed in June, 2017. There were a
couple of goals: to solve the problem reported in

http://lists.gnu.org/archive/html/bug-bash/2017-06/msg00238.html

and to avoid blank lines in the history as the result of `fc -e' (there
aren't any blank history entries in any other cases).

It did both of those things, but the effect is net negative. I can solve
the `read -e' issue in a different way and we can live with the empty
history entries. Your fix is the right one.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to