summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikael <34864484+MikaelFangel@users.noreply.github.com>2023-03-08 23:23:46 +0100
committerMaas Lalani <maas@lalani.dev>2023-03-09 12:59:53 -0500
commitf8adcd649b487502a4d4edad4f62af0e270d3ad2 (patch)
treeaafe5c9b11dd40ab61706718ad075d9b47e1ce4b
parent65f5a7e44e4415bc34ecee3c7632d7c9eaaa3cba (diff)
fixes errors with CR in write --value
-rw-r--r--write/command.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/write/command.go b/write/command.go
index c45118c..3a9668c 100644
--- a/write/command.go
+++ b/write/command.go
@@ -3,6 +3,7 @@ package write
import (
"fmt"
"os"
+ "strings"
"github.com/alecthomas/kong"
"github.com/charmbracelet/bubbles/textarea"
@@ -18,7 +19,7 @@ import (
func (o Options) Run() error {
in, _ := stdin.Read()
if in != "" && o.Value == "" {
- o.Value = in
+ o.Value = strings.Replace(in, "\r", "", -1)
}
a := textarea.New()