Re: problem with using ctrl-x ctrl-e ( open vi editor )

2020-10-19 Thread Chet Ramey
On 10/18/20 10:34 PM, Hyunho Cho wrote:

> Bash Version: 5.0
> Patch Level: 17
> Release Status: release
> 
> #
> 
> bash$ cat <<\EOF  # without using ctrl-x ctrl-e there is no problem
> occurred.
>> 111
>> 222
>> EOF
> 111
> 222
> 
> ---
> 
> bash$ cat <<\EOF
>> 111
>>  < in this line open vi editor with ctrl-x ctrl-e
> and add another 222 line then :wq
> 
> 
> bash$ cat <<\EOF
>> 111
>>
> cat <<\EOF
> 111
> 222
> EOF
> 111< successfully executed cat command with heredoc
> 222
>>
>>
>>
>> ^C   < but does not end ">" prompt until enter ctrl-c

Thanks for the report. Since the commands in the file are executed in a
different execution context, and do not interrupt the parsing of the
current command, what do you think this should do? Bash could simply
disallow that construct if it's in the middle of parsing a compound
command, as other shells do, but it's always done its best to continue
with the compound command.


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



problem with using ctrl-x ctrl-e ( open vi editor )

2020-10-18 Thread Hyunho Cho
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2
-fdebug-prefix-map=/build/bash-a6qmCk/bash-5.0=.
-fstack-protector-strong -Wformat -Werror=format-security -Wall
-Wno-parentheses -Wno-format-security
uname output: Linux EliteBook 5.4.0-42-generic #46-Ubuntu SMP Fri Jul
10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.0
Patch Level: 17
Release Status: release

#

bash$ cat <<\EOF  # without using ctrl-x ctrl-e there is no problem
occurred.
> 111
> 222
> EOF
111
222

---

bash$ cat <<\EOF
> 111
>  < in this line open vi editor with ctrl-x ctrl-e
and add another 222 line then :wq


bash$ cat <<\EOF
> 111
>
cat <<\EOF
111
222
EOF
111< successfully executed cat command with heredoc
222
>
>
>
> ^C   < but does not end ">" prompt until enter ctrl-c