~sircmpwn/aerc

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH] * Compose: Don't rely on existence of /bin/sh

Details
Message ID
<C5EL2G2SC912.2SQOJ92X439ED@localhost>
DKIM signature
missing
Download raw message
Patch: +7 -1
From e19db616644ba52e38b0bf35ecacc9ada35a63a3 Mon Sep 17 00:00:00 2001
Date: Fri, 4 Sep 2020 08:03:49 -0400

---
Termux (Android terminal emulator) is one example
of a non-FHS Compliant system which has no /bin/sh.

 widgets/compose.go | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/widgets/compose.go b/widgets/compose.go
index 03c9175..68e54a9 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -603,7 +603,13 @@ func (c *Composer) ShowTerminal() {
	if editorName == "" {
		editorName = "vi"
	}
	editor := exec.Command("/bin/sh", "-c", editorName+" "+c.email.Name())
	var editor *exec.Cmd
	if _, err := os.Stat("/bin/sh"); err == nil {
		editor = exec.Command("/bin/sh", "-c", editorName+" "+c.email.Name())
	} else {
		split := strings.Split(editorName, " ")
		editor = exec.Command(split[0], append(split[1:], c.email.Name())...)
	}
	c.editor, _ = NewTerminal(editor) // TODO: handle error
	c.editor.OnEvent = c.termEvent
	c.editor.OnClose = c.termClosed
-- 
2.28.0
Details
Message ID
<C5EL6Q6RB7LF.15ON53Q3XWCXP@homura>
In-Reply-To
<C5EL2G2SC912.2SQOJ92X439ED@localhost> (view parent)
DKIM signature
pass
Download raw message
Why not? Any sane Unix system needs to have a shell available at this
path.
Details
Message ID
<F80E333E-D542-480F-B8A2-FA35E95D18E9@labrat.space>
In-Reply-To
<C5EL2G2SC912.2SQOJ92X439ED@localhost> (view parent)
DKIM signature
pass
Download raw message
Hi,
please try to keep the thread intact when you reply to a comment.

I don't think that we should work around non FHS respecting "distros".

There's a reason that things are put in the same place everywhere.
We'd end up with a whole bunch of special snowflake cases which would make it harder to reason about things if we started doing that.

Greetings 
Reto
Review patch Export thread (mbox)