Received: from vps892.directvps.nl (ikke.info [178.21.113.177]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id BDB77780FDD for <~alpine/aports@lists.alpinelinux.org>; Sat, 10 Oct 2020 16:56:50 +0000 (UTC) Received: by vps892.directvps.nl (Postfix, from userid 1008) id 6CFF244012C; Sat, 10 Oct 2020 18:56:50 +0200 (CEST) Date: Sat, 10 Oct 2020 18:56:50 +0200 From: Kevin Daudt To: Reed Wade Cc: ~alpine/aports@lists.alpinelinux.org Subject: Re: [PATCH sxmo-utils v5 1/8] Do not prevent interactive editors to write messages Message-ID: <20201010165650.GB2986883@alpha> References: <20201010135935.19235-1-reedwade@misterbanal.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201010135935.19235-1-reedwade@misterbanal.net> 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 > --- > 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