When I use the command line I can recall history by using C-P or up arrow. However this does not work when trying to recall input to a here-document.
# cat <<!
> a
> b
> c
> !
a
b
c
# cat <<! # C-p to get here, expected to see ! as last input. C-c to break out
# history 2
2053 cat <<!
2054 history 2
I'm using rxvt.
P.S. This feature works correctly when using shell
within emacs
I have the same problem. Bash 3.2.49(1)-release
My history only preserves the first line. I have got cmdhist (and lithist) set, and they work fine for other multi-line commands, but not for heredocs. Tragic.
A workaround is: