Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

prompt.String() stops input after first space is read, not after newline #3

@jandre

Description

@jandre

Test code:

package main

import (
    "fmt"

    prompt "github.com/segmentio/go-prompt"
)

func main() {
    str := prompt.String("Enter some string")
    fmt.Println("Read:", str)
}

running it shows that it breaks at the first space, rather than at the newline:

vagrant@vagrant-ubuntu-trusty-64:/opt/secrets$ go run test.go
Enter some string: ljadjf lasdjflaksjflasdjfl asjfladjsfl
Read: ljadjf
vagrant@vagrant-ubuntu-trusty-64:/opt/secrets$ asdjflaksjflasdjfl asjfladjsfl
asdjflaksjflasdjfl: command not found

I think the expected behavior is that it should function like readline and terminate after a newline, not after a space is inputted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions