Interactive prompt for command-line applications

Overview

promptui

Interactive prompt for command-line applications.

We built Promptui because we wanted to make it easy and fun to explore cloud services with manifold cli.

Code of Conduct | Contribution Guidelines

GitHub release GoDoc Travis Go Report Card License

Overview

promptui

Promptui is a library providing a simple interface to create command-line prompts for go. It can be easily integrated into spf13/cobra, urfave/cli or any cli go application.

Promptui has two main input modes:

  • Prompt provides a single line for user input. Prompt supports optional live validation, confirmation and masking the input.

  • Select provides a list of options to choose from. Select supports pagination, search, detailed view and custom templates.

For a full list of options check GoDoc.

Basic Usage

Prompt

package main

import (
	"errors"
	"fmt"
	"strconv"

	"github.com/manifoldco/promptui"
)

func main() {
	validate := func(input string) error {
		_, err := strconv.ParseFloat(input, 64)
		if err != nil {
			return errors.New("Invalid number")
		}
		return nil
	}

	prompt := promptui.Prompt{
		Label:    "Number",
		Validate: validate,
	}

	result, err := prompt.Run()

	if err != nil {
		fmt.Printf("Prompt failed %v\n", err)
		return
	}

	fmt.Printf("You choose %q\n", result)
}

Select

package main

import (
	"fmt"

	"github.com/manifoldco/promptui"
)

func main() {
	prompt := promptui.Select{
		Label: "Select Day",
		Items: []string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
			"Saturday", "Sunday"},
	}

	_, result, err := prompt.Run()

	if err != nil {
		fmt.Printf("Prompt failed %v\n", err)
		return
	}

	fmt.Printf("You choose %q\n", result)
}

More Examples

See full list of examples

Comments
  • add support for hiding selected text

    add support for hiding selected text

    Sometimes the text displayed after an item is successfully selected is a bit redundant, and hiding it might make the subsequent output look more comfortable.

    opened by royeo 10
  • Export stdin and stderr for unit test ?

    Export stdin and stderr for unit test ?

    First of all, thanks for your work. This library is so awesome! ❤️

    I have a question: Is there any suggestion for write unit test for project that use this library? Maybe export stdin and stderr is a way?

    opened by mozillazg 8
  • Running inside a bash script causes invisible select navigation

    Running inside a bash script causes invisible select navigation

    I noticed that the select functionality (as shown in the README example) fails to update and give visual feedback when running inside a bash script.

    I have this script for my project:

    #!/bin/bash
    
    clear
    
    # Do a lot of help tools and automated work
    
    go run $(find . -maxdepth 1 -type f -name '*.go' ! -name '*_test.go' | xargs)
    

    Running the go run line in Bash or ZSH works fine when navigating the list, but inside the script there's no feedback, although in the Select Day: example, if I press down twice for example and hit enter it did choose Wednesday. So it works, but just doesn't visually update.

    • I'm running macOS High Sierra 10.13.1
    • Go version is go1.9.2 darwin/amd64
    • My ZSH version is 5.3 and Bash version is 3.2
    opened by Allendar 7
  • Customized background support

    Customized background support

    Hello, this tool is awesome! Do you have a plan to support the customized background color for select templates? For example, support customized background color for active, inactive, selected items, etc.

    enhancement 
    opened by TimothyYe 6
  • backspace not working on windows.

    backspace not working on windows.

    This might have more to do with one of the underlying dependencies, but on windows 10 backspace is not working for me when using Prompt.Run()

    Here's how I'm using it:

    // This is within a loop with a new field on each iteration.
    
    prompt := promptui.Prompt{
        Label: field,
    }
    
    result, err := prompt.Run()
    if err != nil {
    	panic(err)
    }
    
    bug 
    opened by KaelBaldwin 6
  • Remove LGPLv3 Dependency

    Remove LGPLv3 Dependency

    This PR addresses https://github.com/manifoldco/promptui/issues/173

    promptui is only using the ansiterm library for its TabWriter. However, this library is licensed under LGPLv3 https://github.com/juju/ansiterm/blob/master/LICENSE, causing licensing issues for other projects that want to include promptui.

    This PR changes promptui to use Go's built in TabWriter rather than the one provided by ansiterm. This could result in some loss in features. All tests are passing still after this change, but it would be good for someone more familiar with the library to verify that this does not cause any significant problems.

    opened by nguyer 5
  • add coverage reporting

    add coverage reporting

    This PR adds coverage reporting to promptui. Since promptui runs tests run for Go versions 1.9, 1.10, and 1.11 - I've configured it to only publish the report to codecov for 1.11.

    opened by davidharrigan 5
  • prompt.go: Adopt io.ReadCloser and io.WriteCloser

    prompt.go: Adopt io.ReadCloser and io.WriteCloser

    As mentioned in #46, there is an error when I run go get github.com/manifoldco/promptui:

    github.com/manifoldco/promptui/prompt.go:88:11: cannot use p.stdin (type io.Reader) as type io.ReadCloser in assignment:
    io.Reader does not implement io.ReadCloser (missing Close method)
    

    This commit simply fixes it(fixes #46). But I'm not sure this will cause side-effects since I haven't read other codes yet.

    opened by hallazzang 5
  • Allow a select list to be searched

    Allow a select list to be searched

    Page up and down were changed to arrow up and down to fit nicely with the help. Maybe the help should be optional or have a tiny Press ? for help instead of the full text.

    enhancement 
    opened by louisbranch 5
  • 3-clause BSDL might be incompatible with LGPLv3 (juju/ansiterm)

    3-clause BSDL might be incompatible with LGPLv3 (juju/ansiterm)

    opened by AkihiroSuda 4
  • Hi, do we support read multiple lines until ctrl+d to generate an io.EOF

    Hi, do we support read multiple lines until ctrl+d to generate an io.EOF

    I use promptui to let user input the issue title and body, the body part contains multiple lines.

    So I think it would be better to support multiple lines in our utility.

    I don't know whether prompui has supported this feature or not.

    opened by hitzhangjie 4
  • Dynamic search based select

    Dynamic search based select

    This would probably be an entirely new feature. But, imagine you have a system with a million users stored in a database. And you want to select one based on a simple text search. Obviously, fetching a million users and rendering them in the select, and then using the searcher function to match them, is infeasible. Instead, you want the items that appear to be selected to be dynamic, using API calls to the backend to fetch the items based on what the user has typed so far. So, to implement it, instead of a static list of items, you'll have a callback:

    func(input string) interface{}
    

    This would have to use goroutines/channels to invoke the search in the background, while allowing the user to continue to enter text, so that after a user types a certain number of characters, it can immediately issue the search callback, and then continue to allow the user to type and refine the search, waiting till the previous callback has returned till it invokes the callback again with the currently input text (if different from the previous callback invocation).

    Since Items in Select is currently interface{}, perhaps it could be possible to add this support to the existing select, I'm not sure if that would make sense or not.

    opened by jroper 0
  • Default searcher implemetation

    Default searcher implemetation

    Hi, firstly thanks for the code. It's great.

    I've had a bit of problem using the search feature but after digging a little bit, I've found my way.

    Have said that, I reckon it would be awesome if there was some kind of default simple implementation of the searcher someone could use that could fit a lot of differet usecases.

    This implementation doesn't add any dependencies since it only uses the std library.

    Here's the idea:

    package main
    
    import (
    	"fmt"
    	"regexp"
    
    	"github.com/manifoldco/promptui"
    )
    
    func SimpleRegexSearcher(items []string) func(input string, index int) bool {
    	return func(input string, index int) bool {
    		reg, _ := regexp.Compile(fmt.Sprintf("(?i).*%s.*", input))
    
    		return reg.MatchString(items[index])
    	}
    }
    
    func main() {
    	items := []string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}
    	prompt := promptui.Select{
    		StartInSearchMode: true,
    		Label:             "Select Day",
    		Items:             items,
    		Searcher:          SimpleRegexSearcher(items),
    	}
    
    	_, result, err := prompt.Run()
    
    	if err != nil {
    		fmt.Printf("Prompt failed %v\n", err)
    		return
    	}
    
    	fmt.Printf("You choose %q\n", result)
    }
    
    

    Let me know if you think this is a good idea so I can make a PR :)

    opened by migueleliasweb 4
  • Stdout should be `io.Writer` instead of `io.WriterCloser`

    Stdout should be `io.Writer` instead of `io.WriterCloser`

    As far as I can see, it is only used in the readline.Config which expects io.Writer, not io.WriterCloser (see here). p.Stdout.Close() is never called.

    It's a bit inconvenient that when I want to configure an io.Writer as Stdout, I always need to wrap it in a struct that implements an unnecessary, no-op Close() function.

    opened by mbalsam82 0
  • Data race after running promptui.Prompt.Run()

    Data race after running promptui.Prompt.Run()

    Hi! Found some data races when using Run() for promptui.Prompt. Is it my bad or is it some bug on your side?

    Sincerely, mindhunter86!


    Code example && data race logs

    Part of my test code:

    package cli
    
    import (
    	"bufio"
    	"bytes"
    	"fmt"
    	"io"
    	"log"
    	"net"
    
    	"github.com/manifoldco/promptui"
    	"github.com/urfave/cli/v2"
    )
    
    func TestDial(c *cli.Context, _ string) (err error) {
    	log.Println("trying to connect via unix socket")
    
    	conn, err := net.Dial("unix", c.String("socket-path"))
    	if err != nil {
    		return
    	}
    	defer conn.Close()
    	log.Println("connection successfull")
    
    	var buf = bytes.NewBuffer(nil)
    
    	for {
    		buf.Reset()
    
    		pr := promptui.Prompt{
    			Label: ":>",
    			Templates: &promptui.PromptTemplates{
    				Prompt:  "{{ . }} ",
    				Valid:   "{{ . | green }} ",
    				Invalid: "{{ . | red }} ",
    				Success: "{{ . | bold }} ",
    			},
    			AllowEdit: true,
    		}
    
    		var data string
    		data, err = pr.Run()
    		if err != nil {
    			return
    		}
    
    		buf.WriteString(data + "\n")
    		_, err = io.Copy(conn, buf)
    		if err != nil {
    			return
    		}
    
    		buf.Reset()
    
    		scanner := bufio.NewScanner(conn)
    		var lines []string
    		for {
    			scanner.Scan()
    			line := scanner.Text()
    			if len(line) == 0 {
    				break
    			}
    
    			lines = append(lines, line)
    		}
    
    		if scanner.Err() != nil {
    			return
    		}
    
    		for _, line := range lines {
    			fmt.Println(line)
    		}
    	}
    }
    

    Data races logs:

    ==================
    WARNING: DATA RACE
    Read at 0x00c000186578 by main goroutine:
      github.com/manifoldco/promptui.(*Cursor).Get()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/cursor.go:151 +0x52
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:196 +0xd10
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous write at 0x00c000186578 by goroutine 24:
      github.com/manifoldco/promptui.(*Cursor).Update()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/cursor.go:145 +0x5dd
      github.com/manifoldco/promptui.(*Cursor).Listen()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/cursor.go:203 +0x135
      github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:162 +0x14a
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    ==================
    ==================
    WARNING: DATA RACE
    Write at 0x00c000536080 by main goroutine:
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:196 +0xd75
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous read at 0x00c000536080 by goroutine 24:
      github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:183 +0x7eb
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]24d48e/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    ==================
    ==================
    WARNING: DATA RACE
    Read at 0x00c000186540 by main goroutine:
      bytes.(*Buffer).Reset()
          /usr/local/go/src/bytes/buffer.go:98 +0x37
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Reset()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:36 +0x57
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:243 +0x190f
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous write at 0x00c000186540 by goroutine 24:
      bytes.(*Buffer).Reset()
          /usr/local/go/src/bytes/buffer.go:98 +0x4c
      bytes.(*Buffer).WriteTo()
          /usr/local/go/src/bytes/buffer.go:268 +0x336
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Flush()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:128 +0x33a
      github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:188 +0x9d3
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    ==================
    ==================
    WARNING: DATA RACE
    Write at 0x00c000186558 by main goroutine:
      bytes.(*Buffer).Reset()
          /usr/local/go/src/bytes/buffer.go:99 +0x71
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Reset()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:36 +0x57
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:243 +0x190f
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous write at 0x00c000186558 by goroutine 24:
      bytes.(*Buffer).WriteTo()
          /usr/local/go/src/bytes/buffer.go:256 +0x230
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Flush()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:128 +0x33a
      github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:188 +0x9d3
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    ==================
    ==================
    WARNING: DATA RACE
    Write at 0x00c000186560 by main goroutine:
      bytes.(*Buffer).Reset()
          /usr/local/go/src/bytes/buffer.go:100 +0x96
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Reset()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:36 +0x57
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:243 +0x190f
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous write at 0x00c000186560 by goroutine 24:
      bytes.(*Buffer).Reset()
          /usr/local/go/src/bytes/buffer.go:100 +0x96
      bytes.(*Buffer).WriteTo()
          /usr/local/go/src/bytes/buffer.go:268 +0x336
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Flush()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:128 +0x33a
      github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:188 +0x9d3
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    ==================
    ==================
    WARNING: DATA RACE
    Write at 0x00c000186528 by main goroutine:
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Reset()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:37 +0x6f
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:243 +0x190f
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]17.1/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous write at 0x00c000186528 by goroutine 24:
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Reset()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:37 +0x6f
      github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:181 +0x789
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    ==================
    ==================
    WARNING: DATA RACE
    Read at 0x00c000186538 by main goroutine:
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Clear()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:42 +0x7a
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Write()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:68 +0x2ec
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:244 +0x195c
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous write at 0x00c000186538 by goroutine 24:
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Clear()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:53 +0x27b
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Write()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:68 +0x2ec
      github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:182 +0x7d6
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    ==================
    ==================
    WARNING: DATA RACE
    Write at 0x00c0000fe0c0 by main goroutine:
      runtime.slicecopy()
          /usr/local/go/src/runtime/slice.go:307 +0x0
      bytes.(*Buffer).Write()
          /usr/local/go/src/bytes/buffer.go:172 +0x1fa
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Clear()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:43 +0x104
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Write()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:68 +0x2ec
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:244 +0x195c
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous write at 0x00c0000fe0c0 by goroutine 24:
      runtime.slicecopy()
          /usr/local/go/src/runtime/slice.go:307 +0x0
      bytes.(*Buffer).Write()
          /usr/local/go/src/bytes/buffer.go:172 +0x1fa
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Flush()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:136 +0x495
      github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:188 +0x9d3
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    ==================
    ==================
    WARNING: DATA RACE
    Write at 0x00c000186530 by main goroutine:
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Clear()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:52 +0x253
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Write()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:68 +0x2ec
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:244 +0x195c
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous write at 0x00c000186530 by goroutine 24:
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Flush()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:142 +0x536
      github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:188 +0x9d3
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    ==================
    ==================
    WARNING: DATA RACE
    Write at 0x00c0000fe0c9 by main goroutine:
      runtime.slicecopy()
          /usr/local/go/src/runtime/slice.go:307 +0x0
      bytes.(*Buffer).Write()
          /usr/local/go/src/bytes/buffer.go:172 +0x1fa
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Write()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:75 +0x45e
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:244 +0x195c
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous write at 0x00c0000fe0c9 by goroutine 24:
      runtime.slicecopy()
          /usr/local/go/src/runtime/slice.go:307 +0x0
      bytes.(*Buffer).Write()
          /usr/local/go/src/bytes/buffer.go:172 +0x1fa
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Write()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:75 +0x45e
      github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:182 +0x7d6
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    ==================
    ==================
    WARNING: DATA RACE
    Write at 0x00c0000fe0e4 by main goroutine:
      runtime.slicecopy()
          /usr/local/go/src/runtime/slice.go:307 +0x0
      bytes.(*Buffer).Write()
          /usr/local/go/src/bytes/buffer.go:172 +0x1fa
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Write()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/screenbuf/screenbuf.go:85 +0x6f5
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:244 +0x195c
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    Previous write at 0x00c0000fe0e0 by goroutine 24:
      runtime.slicecopy()
          /usr/local/go/src/runtime/slice.go:307 +0x0
      bytes.(*Buffer).Write()
          /usr/local/go/src/bytes/buffer.go:172 +0x1fa
      github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Write()  github.com/manifoldco/promptui.(*Prompt).Run.func2()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:182 +0x7d6
      github.com/chzyer/readline.(*DumpListener).OnChange()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:516 +0x12a
      github.com/chzyer/readline.(*Operation).ioloop()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:339 +0x26ea
      github.com/chzyer/readline.NewOperation.func2()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x44
    
    Goroutine 24 (running) created at:
      github.com/chzyer/readline.NewOperation()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/operation.go:88 +0x8e9
      github.com/chzyer/readline.(*Terminal).Readline()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/terminal.go:95 +0x6e
      github.com/chzyer/readline.NewEx()
          /workspaces/repos/pkg/mod/github.com/chzyer/[email protected]/readline.go:167 +0x13b
      github.com/manifoldco/promptui.(*Prompt).Run()
          /workspaces/repos/pkg/mod/github.com/manifoldco/[email protected]/prompt.go:138 +0x55e
      github.com/MindHunter86/aniliSeeder/cli.TestDial()
          /workspaces/repos/aniliSeeder/cli/cli.go:59 +0x764
      main.main.func3()
          /workspaces/repos/aniliSeeder/main.go:294 +0x4b
      github.com/urfave/cli/v2.(*Command).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/command.go:177 +0x1449
      github.com/urfave/cli/v2.(*App).RunContext()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:387 +0x1974
      github.com/urfave/cli/v2.(*App).Run()
          /workspaces/repos/pkg/mod/github.com/urfave/cli/[email protected]/app.go:252 +0xd3
      main.main()
          /workspaces/repos/aniliSeeder/main.go:302 +0x5fd4
    
    opened by MindHunter86 0
  • Empty lines in output?

    Empty lines in output?

    I am fairly new to Golang, so I'm unsure if this is a problem with my code, Cobra, Promptui, or something else.

    I have set up a minimal repro below, using jsonplaceholder's posts endpoint. Every time I run the following command, I seem to get a different output with random lines missing.

    Windows 10, Powershell, Windows Terminal.

    type Post struct {
    	UserId int
    	Id     int
    	Title  string
    	Body   string
    }
    
    var posts []Post
    var postTitles []string
    
    res, err := http.Get("https://jsonplaceholder.typicode.com/posts")
    
    if err != nil {
    	log.Fatalln(err)
    }
    
    defer res.Body.Close()
    
    responseData, err := io.ReadAll(res.Body)
    
    if err != nil {
    	log.Fatalln(err)
    }
    
    err = json.Unmarshal(responseData, &posts)
    
    if err != nil {
    	fmt.Println("error:", err)
    }
    
    for _, post := range posts {
    	postTitles = append(postTitles, post.Title)
    }
    
    prompt := promptui.Select{
    	Label: "Select Division",
    	Items: postTitles,
    }
    
    i, _, err := prompt.Run()
    
    if err != nil {
    	fmt.Printf("Prompt failed %v\n", err)
    	return
    }
    
    fmt.Printf("Title: %q\n", posts[i].Title)
    fmt.Printf("Body: %q\n", posts[i].Body)
    

    Output on the command line:

    C:\Users\hoadt\Development\cobrademo> go run main.go testcommand
    v sunt aut facere repellat provident occaecati excepturi optio reprehenderit
    Title: "sunt aut facere repellat provident occaecati excepturi optio reprehenderit"
    Body: "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
    
    ===
    
    C:\Users\hoadt\Development\cobrademo> go run main.go testcommand
    v sunt aut facere repellat provident occaecati excepturi optio reprehenderit
    
    Body: "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
    
    ===
    
    C:\Users\hoadt\Development\cobrademo> go run main.go testcommand
    v sunt aut facere repellat provident occaecati excepturi optio reprehenderit
    Title: "sunt aut facere repellat provident occaecati excepturi optio reprehenderit"
    Body: "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
    
    ===
    
    C:\Users\hoadt\Development\cobrademo> go run main.go testcommand
    v sunt aut facere repellat provident occaecati excepturi optio reprehenderit
    Title: "sunt aut facere repellat provident occaecati excepturi optio reprehenderit"
    Body: "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
    
    ===
    
    C:\Users\hoadt\Development\cobrademo> go run main.go divisions
    v sunt aut facere repellat provident occaecati excepturi optio reprehenderit
    
    
    ===
    
    C:\Users\hoadt\Development\cobrademo> go run main.go testcommand
    v sunt aut facere repellat provident occaecati excepturi optio reprehenderit
    Title: "sunt aut facere repellat provident occaecati excepturi optio reprehenderit"
    Body: "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
    
    ===
    
    C:\Users\hoadt\Development\cobrademo> go run main.go testcommand
    v sunt aut facere repellat provident occaecati excepturi optio reprehenderit
    
    
    
    ===
    
    C:\Users\hoadt\Development\cobrademo> go run main.go testcommand
    v sunt aut facere repellat provident occaecati excepturi optio reprehenderit
    Title: "sunt aut facere repellat provident occaecati excepturi optio reprehenderit"
    Body: "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
    
    opened by tomhoad 0
  • Git Bash Prompts fail with EOF

    Git Bash Prompts fail with EOF

    Currently I am unable to use Git Bash with this library. All prompts are immediately terminated with an EOF.

    Find the example repository with all three test cases here: https://github.com/Silthus/promptui-git-bash-bug

    image image image

    I don't know but this may be related to this issue? https://github.com/chzyer/readline/issues/191

    opened by Silthus 0
Releases(v0.9.0)
  • v0.9.0(Oct 30, 2021)

    What's Changed

    • Remove LGPLv3 Dependency by @nguyer in https://github.com/manifoldco/promptui/pull/181

    New Contributors

    • @nguyer made their first contribution in https://github.com/manifoldco/promptui/pull/181

    Full Changelog: https://github.com/manifoldco/promptui/compare/v0.8.0...v0.9.0

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Sep 28, 2020)

    Added

    • Support ctrl-h for backspace
    • Allow hiding entered data after submit
    • Allow masking input with an empty rune to hide input length

    Fixed

    • Fix echo of cursor after input is finished
    • Better support for keycodes on Windows
    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Jan 11, 2020)

    Added

    • Add support for configurable Stdin/Stdout on Prompt
    • Add support for setting initial cursor position
    • Switch to golangci-lint for linting

    Removed

    • Removed support for Go 1.11

    Fixed

    • Reduce tool-based deps, hopefully fixing any install issues
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Nov 29, 2019)

  • v0.5.0(Nov 29, 2019)

  • v0.3.0(May 22, 2018)

    Added

    • Background colors codes and template helpers
    • AllowEdit for prompt to prevent deletion of the default value by any key
    • Added StartInSearchMode to allow starting the prompt in search mode

    Fixed

    • <Enter> key press on Windows
    • juju/ansiterm dependency
    • chzyer/readline#136 new api with ReadCloser
    • Deleting UTF-8 characters sequence
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Nov 30, 2017)

  • v0.2.0(Nov 30, 2017)

  • v0.1.0(Nov 30, 2017)

    Added

    • extract promptui from torus as a standalone lib.
    • promptui.Prompt provides a single input line to capture user information.
    • promptui.Select provides a list of options to choose from. Users can navigate through the list either one item at time or by pagination
    Source code(tar.gz)
    Source code(zip)
Owner
Manifold
Manifold is a place to find, buy, and manage cloud services.
Manifold
A command line tool to prompt for a value to be included in another command line.

readval is a command line tool which is designed for one specific purpose—to prompt for a value to be included in another command line. readval prints

Venky 0 Dec 22, 2021
Building powerful interactive prompts in Go, inspired by python-prompt-toolkit.

go-prompt A library for building powerful interactive prompts inspired by python-prompt-toolkit, making it easier to build cross-platform command line

Masashi Shibata 4.7k Nov 20, 2022
Interactive prompt to set and push a semver tag

cutver For when you know what version to tag, and you want to cut a release in the annotated tag format. Installation go install github.com/roryq/cutv

Rory Quinn 8 Nov 15, 2022
A simple CLI based rock-paper-scissors game created in GO with interactive shell prompt.

rock-paper-scissors A simple CLI (Command Line Interface) based rock-paper-scissors game with interactive shell prompt. Language Download Grab a binar

Saif Shahriar 0 Oct 9, 2022
Pure Go command line prompt with history, kill-ring, and tab completion

Prompt Prompt is a command line prompt editor with history, kill-ring, and tab completion. It was inspired by linenoise and derivatives which eschew u

Peter Mattis 1 Nov 20, 2021
🔥 [WIP] Interactive Jira Command Line

JiraCLI Interactive Jira CLI ?? This project is still a work in progress ?? This tool mostly focuses on issue search and navigation at the moment. How

Ankit Pokhrel 2.2k Nov 23, 2022
An interactive command-line tool to manage your environments

goto An interactive command-line tool to manage your environments Overview You always need to login to some Linux machine or connect to a MySQL instan

Lucien 10 Jul 11, 2022
An open-source GitLab command line tool bringing GitLab's cool features to your command line

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching

Clement Sam 2.1k Nov 22, 2022
A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

null 0 Nov 22, 2021
Strumt is a library to create prompt chain

Strumt Strumt is a library to create prompt chain. It provides multiline prompt, input validation, retry on error, ability to create typesafe prompt,

Anthony HAMON 49 Sep 26, 2022
Shelby is a fast ⚡️ , lightweight ☁️ , minimal✨, shell prompt written in Go.

Shelby is a fast ⚡️ ,lightweight ☁️ ,minimal ✨ , shell prompt written in Pure Go. Installation Follow the steps below(Linux and macOS), and Post Insta

Athul Cyriac Ajay 167 Oct 21, 2022
The extremely customizable and themeable shell prompt.

kitch-prompt Kitch-prompt is a cross-platform tool for displaying a shell prompt, which can be extensively customized both in terms of what is shown,

Jason Walton 14 Nov 22, 2022
Simple and complete API for building command line applications in Go

Simple and complete API for building command line applications in Go Module cli provides a simple, fast and complete API for building command line app

teris.io 117 Nov 23, 2022
A Go library for building command line applications

gocmd A Go library for building command line applications. Features Advanced command line arguments handling Subcommand handling Short and long comman

Fatih Cetinkaya 62 Nov 2, 2022
Soren L. Hansen 1.7k Nov 21, 2022
MyApps is a universal command line tool for managing manually installed applications.

MyApps MyApps is a universal command line tool for managing manually installed applications. Disclaimer I wrote this tool over two long nights while p

Piotr Icikowski 5 Jul 15, 2022
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

asciigraph Go package to make lightweight ASCII line graphs ╭┈╯. Installation go get github.com/guptarohit/asciigraph Usage Basic graph package main

Rohit Gupta 2.1k Nov 28, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Gruntwork 685 Nov 21, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Maxar Infrastructure 1 Feb 5, 2022