bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Command-line editor unexpectedly memorable


From: Johannes Hielscher
Subject: Command-line editor unexpectedly memorable
Date: Fri, 8 Feb 2019 20:50:48 +0100

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe
-fstack-protector-strong -fno-plt
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin'
-DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc'
-DSYS_BASH_LOGOUT='/etc/bash.bash_logout'
-DNON_INTERACTIVE_LOGIN_SHELLS -Wno-parentheses -Wno-format-security
uname output: Linux localhost 4.14.78-1-lts #1 SMP Sun Oct 21 14:04:15
CEST 2018 x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu

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.

Repeat-By:
        Empty bash prompt:
        C-x C-e (emacs mode) or <Esc>v (vi mode)
        $EDITOR opens with the last line of history instead of an empty
        buffer (as was the case in earlier bash versions).

        Observed with the most current bash packages of Archlinux
        (5.0.0-1) and Debian Testing (5.0-2), as well as bash-5.0
        compiled from the release source tarball.

Fix:
        I could restore the old behaviour by making the
                if (rl_line_buffer[0])
        conditional always true in bashline.c:965 (as it essentially was
        in bash<=4.4), but I have no idea about side effects.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]