~emersion/hut-dev

pager/editor: Invoke command with "sh -c" v1 SUPERSEDED

Thorben Günther: 1
 pager/editor: Invoke command with "sh -c"

 2 files changed, 2 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/hut-dev/patches/48676/mbox | git am -3
Learn more about email & git

[PATCH] pager/editor: Invoke command with "sh -c" Export this patch

Closes: https://todo.sr.ht/~emersion/hut/44
---
 main.go  | 2 +-
 pager.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/main.go b/main.go
index 7c05bee..eb18b2b 100644
--- a/main.go
+++ b/main.go
@@ -152,7 +152,7 @@ func getInputWithEditor(pattern, initialText string) (string, error) {
		return "", err
	}

	cmd := exec.Command(editor, file.Name())
	cmd := exec.Command("sh", "-c", fmt.Sprintf("%s %s", editor, file.Name()))
	cmd.Stdin = os.Stdin
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
diff --git a/pager.go b/pager.go
index 7615f89..424d07b 100644
--- a/pager.go
+++ b/pager.go
@@ -24,7 +24,7 @@ func newPager() pager {
		name = "less"
	}

	cmd := exec.Command(name)
	cmd := exec.Command("sh", "-c", name)
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	cmd.Env = append(os.Environ(), "LESS=FRX")

base-commit: 499ef88754326222b1567261ac6b39b9f2a586ed
--
2.43.0