From dd557baf6a935bd0aa0f98a8084f64da166d3bc5 Mon Sep 17 00:00:00 2001 From: Piero Lescano Date: Tue, 14 Nov 2023 16:54:45 -0500 Subject: [PATCH] fix(input): Avoid reading from stdin if `--value` is being used (#448) --- input/command.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/input/command.go b/input/command.go index 4094ddb..8ff1fe0 100644 --- a/input/command.go +++ b/input/command.go @@ -18,10 +18,10 @@ import ( // https://github.com/charmbracelet/bubbles/textinput func (o Options) Run() error { i := textinput.New() - if in, _ := stdin.Read(); in != "" && o.Value == "" { - i.SetValue(in) - } else { + if o.Value != "" { i.SetValue(o.Value) + } else if in, _ := stdin.Read(); in != "" { + i.SetValue(in) } i.Focus()