From f8adcd649b487502a4d4edad4f62af0e270d3ad2 Mon Sep 17 00:00:00 2001 From: mikael <34864484+MikaelFangel@users.noreply.github.com> Date: Wed, 8 Mar 2023 23:23:46 +0100 Subject: [PATCH] fixes errors with CR in write --value --- write/command.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()