X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/829a405011c59fded10d42ca3b71af7b23cde116..a83d50d5a64488deb3796bbd0ca0a03b0516cc77:/.mutt/edit-header diff --git a/.mutt/edit-header b/.mutt/edit-header index c87717a..ab7444b 100755 --- a/.mutt/edit-header +++ b/.mutt/edit-header @@ -30,6 +30,10 @@ get_header_contents() script="${0%/*}/${2:-}" if [ -f "$script" ] && [ -x "$script" ]; then + if [ -z "${__RLWRAPPED:-}" ] && [ -x $(command -v rlwrap) ]; then + __RLWRAPPED=true exec rlwrap "$0" "$@" + fi + contents_source="$script" shift else @@ -60,9 +64,12 @@ case "$0" in esac -echo "set my_editor=\"\$editor\'" -echo "set editor=\"$editor\"" -#echo "push " -echo "push " -# we need to push this so it happens after the editing -echo "push :set editor=\"\$my_editor\"" +echo "set my_editor=\"\$editor\"" +echo "set my_filter=\"$editor\"" +echo -n "push '" +echo -n "set editor=\"\$my_filter\"" +echo -n "" +echo -n "set editor=\"\$my_editor\"" +echo -n "unset my_filter" +echo -n "unset my_editor" +echo "'"