diff --git a/dobroho_vechora.bash b/dobroho_vechora.bash index b4726ae..3181cdf 100755 --- a/dobroho_vechora.bash +++ b/dobroho_vechora.bash @@ -91,17 +91,10 @@ while :; do read cmd case "${cmd}" in I) - b="" - while :; do - read c - [[ "${c}" != "." ]] || break - if [ -z ${b} ]; then - b="${c}" - else - b="${b}"$'\n'"${c}" - fi - done - send_message 0"${nick}${b}" + tmp="$(mktemp)" + command ${VISUAL:-${EDITOR:-$(command -v vi)}} "${tmp}" + [ -s "${tmp}" ] && send_message 0"${nick}$(cat "${tmp}")" + rm "${tmp}" ;; i) read a