On Sat, Oct 10, 2020 at 03:59:28PM +0200, Reed Wade wrote:
> We run EDITOR in a subshell and that prevent some editors as kakoune :> > Fatal error: stdout is not a tty> > This refactorise a little bit editmsg logic to not run EDITOR in a> subshell and allow those editors to work.> > Signed-off-by: Reed Wade <reedwade@misterbanal.net>> ---> scripts/modem/sxmo_modemtext.sh | 11 ++++++-----> 1 file changed, 6 insertions(+), 5 deletions(-)> > Rebased works. I expect it to be mergeable now !> > diff --git a/scripts/modem/sxmo_modemtext.sh b/scripts/modem/sxmo_modemtext.sh> index 61ca43d..2551dec 100755> --- a/scripts/modem/sxmo_modemtext.sh> +++ b/scripts/modem/sxmo_modemtext.sh> @@ -22,14 +22,12 @@ modem_n() {> }> > editmsg() {> - TMP="$(mktemp --suffix "$1_msg")"> - echo "$2" > "$TMP"> + TMP="$1"> if [ "$TERMMODE" != "true" ]; then> st -e "$EDITOR" "$TMP"> else> "$EDITOR" "$TMP"> fi> - cat "$TMP"> }> > sendtextmenu() {> @@ -47,7 +45,10 @@ sendtextmenu() {> echo "$NUMBER" | grep -qE '^[+0-9]+$' || err "That doesn't seem like a valid number"> > # Compose first version of msg> - TEXT="$(editmsg "$NUMBER" 'Enter text message here')"> + TMP="$(mktemp --suffix "${NUMBER}_msg")"> + echo 'Enter text message here' > "$TMP"> + editmsg "$TMP"> + TEXT="$(cat "$TMP")"> > while true> do> @@ -57,7 +58,7 @@ sendtextmenu() {> )"> echo "$CONFIRM" | grep -E "^Send" && (echo "$TEXT" | sxmo_modemsendsms.sh "$NUMBER" -) && exit 0> echo "$CONFIRM" | grep -E "^Cancel$" && exit 1> - echo "$CONFIRM" | grep -E "^Edit Message" && TEXT="$(editmsg "$NUMBER" "$TEXT")"> + echo "$CONFIRM" | grep -E "^Edit Message" && editmsg "$TMP" && TEXT="$(cat "$TMP")"> done> }> > --> 2.28.0
I think you send this to the wrong mailing list. This does not seem to
have anything to do with Alpine Linux aports.
Kevin