bug-bash
[Top][All Lists]
Advanced

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

bind -x keyseq:shell_func related misbehaviour


From: Matthias Benkmann
Subject: bind -x keyseq:shell_func related misbehaviour
Date: Tue, 9 Apr 2002 12:15:09 +0200

Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i586'  
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i586-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib
-g -O2
uname output: Linux buddha 2.4.16 #1 Thu Feb 7 15:54:28 CET 2002 i586
unknown Machine Type: i586-pc-linux-gnu

Bash Version: 2.05a
Patch Level: 0
Release Status: release

Description:
        Using bind -x keyseq:func I assign a shell function to a key.
        Whenever I press this key, the function is properly executed but
        bash seems to be in an inconsistent state for the duration of the
        next prompt.
        NOTE: This bug was even worse in bash-2.05. It has been fixed
        somewhat in bash-2.05a but there are still some quirks (see
        Repeat-By).

Repeat-By:
        # 1st problem:
        PROMPT_COMMAND='PS1="`pwd`> "'
        func() { cd.. ; }
        bind -x '"\C-o":func'
        
        #Now press Ctrl-O. Bash gives a new prompt that shows the
        #directory unchanged. 
        #Press ENTER or Ctrl-C so that bash gives you a new prompt.
        #The new prompt shows that in fact the directory was changed.
        
        # 2nd problem:
        alias l='ls -la'
        func() { : ; }  
        bind -x '"\C-o":func'
        l  #just to see that the alias works
        drwxr-xr-x    2 root     root         4096 Jan 28 15:26 .
        drwxr-xr-x   21 root     root         4096 Feb 16 11:38 ..
        
        #Now press Ctrl-O. Bash gives a new prompt.

        l   #try the alias again 
        bash: l: command not found
        #^^^^^^^^^^^^^^^^^^^^^^^^^  Somehow bash has forgotten the alias

        l   #try yet another time
        drwxr-xr-x    2 root     root         4096 Jan 28 15:26 .
        drwxr-xr-x   21 root     root         4096 Feb 16 11:38 ..
        #^^^^^^^^^^^^^^^^^^^^^^^^^^ Now it's working again



reply via email to

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