bug-bash
[Top][All Lists]
Advanced

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

edit-and-execute-command in non-posix vi editing mode fails with default


From: Mike Stroyan
Subject: edit-and-execute-command in non-posix vi editing mode fails with default editor
Date: Thu, 9 Mar 2006 13:30:25 -0700
User-agent: Mutt/1.5.9i

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2
uname output: Linux hpstryn6 2.6.15-1-amd64-k8-smp #2 SMP Thu Feb 23 04:57:49 
UTC 2006 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 3.1
Patch Level: 0
Release Status: release

Description:
        The default edit-and-execute-command behavior for non-posix vi
        editing mode fails when EDITOR is not set.  It has changed from
        using vi in 3.0 to trying to use 'editor' first in 3.1.  But it
        fails to start an editor and just executes the unchanged command line.

Repeat-By:
        Start bash
        set -o vi
        unset EDITOR
        Type 'date<esc>v'
        The date command is run without a chance to edit it.

Fix:
        Remove an extra right parenthesis from bashline.c.

--- bash/bashline.c~    2006-01-31 13:30:34.000000000 -0700
+++ bash/bashline.c     2006-03-09 12:32:24.000000000 -0700
@@ -800,7 +800,7 @@
    command being entered (if no explicit argument is given), otherwise on
    a command from the history file. */
 
-#define VI_EDIT_COMMAND                "fc -e \"${VISUAL:-${EDITOR:-$(command 
-v editor || echo vi))}}\""
+#define VI_EDIT_COMMAND                "fc -e \"${VISUAL:-${EDITOR:-$(command 
-v editor || echo vi)}}\""
 #define EMACS_EDIT_COMMAND     "fc -e \"${VISUAL:-${EDITOR:-$(command -v 
editor || echo emacs)}}\""
 #define POSIX_VI_EDIT_COMMAND  "fc -e vi"
 




reply via email to

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