bug-bash
[Top][All Lists]
Advanced

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

Re: Read builtin -e (readline) oddities


From: Chet Ramey
Subject: Re: Read builtin -e (readline) oddities
Date: Tue, 20 Jun 2017 10:43:05 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

On 6/19/17 3:40 PM, Chet Ramey wrote:

>> #3
>> Hit `C-x C-e' thrice. Also, the mapping of `\C-m' became `self-insert' 
>> instead
>> of `accept-line'.
> 
> `read -e' changes it because it's no longer the line delimiter.
> 
>>   address@hidden:~$ PATH= EDITOR=: read -e -d ''
>>   
>>   PATH= EDITOR=: read -e -d ''; 
>>   
>>   fc -e "${VISUAL:-${EDITOR:-$(command -v editor || echo emacs)}}"
>>   : /tmp/bash-fc.IZAzmF
>>   PATH= EDITOR=: read -e -d ''; ; 
>>   bash: syntax error near unexpected token `;'
>>   
>>   fc -e "${VISUAL:-${EDITOR:-$(command -v editor || echo emacs)}}"
>>   vim /tmp/bash-fc.35ePED
>>   ^M^M^C
> 
> I'll have to check why it doesn't get restored on ^C.

It does get restored, but the code only has one level of restoration, so
the recursive calls overwrite it.  Who's going to do multiple levels of
edit-and-execute-command?

If you want to run multiple recursive versions of edit-and-execute-
command, you should be savvy enough to get out using ^@ (control-shift-2),
right? :-)

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



reply via email to

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