~scoopta/wofi

3 2

[PATCH] Fix terminal exec parameter when running command in a terminal as all terminals using the option '-e' by convention

Details
Message ID
<8d6101c0228adc5f9189.1588711500@jerry-laptop-arch.localdomain>
DKIM signature
pass
Download raw message
# HG changeset patch
# User Jerry Chanut <j.chanut@gmail.com>
# Date 1588711081 -7200
#      Tue May 05 22:38:01 2020 +0200
# Node ID 8d6101c0228adc5f9189b454414eb6a637c69630
# Parent  71ee23539399a8b08033a7fdbd5aae2550c9c127
Fix terminal exec parameter when running command in a terminal as all terminals using the option '-e' by convention

diff -r 71ee23539399 -r 8d6101c0228a src/wofi.c
--- a/src/wofi.c	Sat Apr 25 12:09:17 2020 -0400
+++ b/src/wofi.c	Tue May 05 22:38:01 2020 +0200
@@ -810,11 +810,11 @@
 
 void wofi_term_run(const char* cmd) {
 	if(terminal != NULL) {
-		execlp(terminal, terminal, "--", cmd, NULL);
+		execlp(terminal, terminal, "-e", cmd, NULL);
 	}
 	size_t term_count = sizeof(terminals) / sizeof(char*);
 	for(size_t count = 0; count < term_count; ++count) {
-		execlp(terminals[count], terminals[count], "--", cmd, NULL);
+		execlp(terminals[count], terminals[count], "-e", cmd, NULL);
 	}
 	fprintf(stderr, "No terminal emulator found please set term in config or use --term\n");
 	exit(1);
Scoopta
Details
Message ID
<4825649e-06bb-7695-3be7-64588616e14b@scoopta.email>
In-Reply-To
<8d6101c0228adc5f9189.1588711500@jerry-laptop-arch.localdomain> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Which terminals are you referring to? gnome-terminal specifically warns
about -e being deprecated and that -- should be used instead because -e
may be removed in the future. -- also prevents getopt from parsing
stuff. -- also works on the terminals I've tested, albeit that's not all
of the ones wofi supports.
Scoopta
Details
Message ID
<1cfdaebe-ec30-628d-b410-244f43552b7b@scoopta.email>
In-Reply-To
<4825649e-06bb-7695-3be7-64588616e14b@scoopta.email> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
I will begrudgingly push this as I didn't realize it was so broken but
it'd be nice if everyone agreed on what to use. Hopefully gnome-terminal
doesn't remove -e otherwise I'll just have to drop that from the
official terminal list until everyone supports --. If that ever happens,
-- is arguably technically better but oh well.
Details
Message ID
<C2JHCLQ8FODN.10SM6AXSXUCYF@jerry-laptop-arch>
In-Reply-To
<1cfdaebe-ec30-628d-b410-244f43552b7b@scoopta.email> (view parent)
DKIM signature
pass
Download raw message
I agree with you. It is the least worst solution.
Maybe we could set the terminal exec option with a configuration option
in wofi : default will be -- and -e (or another) will be set by the new wofi 
option.
Anyway, thanks for the push.

On Tue May 5, 2020 at 4:26 PM CEST, Scoopta wrote:
> --QtT4GyKLHeaRTCOkdqIJdwOCrRImzQXj5
> Content-Type: text/plain; charset=utf-8
> Content-Transfer-Encoding: quoted-printable
> Content-Language: en-US
>
> I will begrudgingly push this as I didn't realize it was so broken but
> it'd be nice if everyone agreed on what to use. Hopefully gnome-terminal
> doesn't remove -e otherwise I'll just have to drop that from the
> official terminal list until everyone supports --. If that ever happens,
> -- is arguably technically better but oh well.
>
>
>
> --QtT4GyKLHeaRTCOkdqIJdwOCrRImzQXj5--
Reply to thread Export thread (mbox)