Skip to content
This repository was archived by the owner on Jan 16, 2021. It is now read-only.

Commit 9a35e12

Browse files
committed
add new line to selection prompt
looks like %s can consume everything in unix systems but in windows new line is not put into %s, this causes a weird case where new line is passed onto the next scanf causing confusion while selecting an app during new flow for windows users. identified via a bug report
1 parent f617b7a commit 9a35e12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

parsecli/apps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func (a *Apps) SelectApp(apps []*App, msg string, e *Env) (*App, error) {
148148
fmt.Fprintf(e.Out, "%s%s", selectionString(appNames), msg)
149149

150150
var selected string
151-
fmt.Fscanf(e.In, "%s", &selected)
151+
fmt.Fscanf(e.In, "%s\n", &selected)
152152
if pos, err = strconv.Atoi(strings.TrimSpace(selected)); err != nil {
153153
pos = -1
154154
break

0 commit comments

Comments
 (0)