From 6f83e8a7e95dea7481bdfb50f50c1832b3e47453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?b=CA=B0edoh=E2=82=82=20sw=C3=A9?= Date: Sun, 12 Jan 2025 04:31:31 +0500 Subject: [PATCH] Change "I". --- dobroho_vechora.bash | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) 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