Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it will return an EOF error when run with git bash on windows #191

Open
rhettli opened this issue Mar 2, 2021 · 4 comments
Open

it will return an EOF error when run with git bash on windows #191

rhettli opened this issue Mar 2, 2021 · 4 comments

Comments

@rhettli
Copy link

rhettli commented Mar 2, 2021

1.The go code:

	rl, err := readline.New("> ")
	if err != nil {
		fmt.Println("ERROR:",err)
		return
	}

	defer rl.Close()
	if str, err := rl.Readline(); err == nil {
		fmt.Println(str)
	}else {
		fmt.Println("err:",err)  // got a error here when program started
	}

2.The error bellow:

image

3. Are there some skill to fix it? thx.

@rhettli rhettli changed the title it will return a EOL error when run with git bash on windows it will return a EOF error when run with git bash on windows Mar 2, 2021
@rhettli rhettli changed the title it will return a EOF error when run with git bash on windows it will return an EOF error when run with git bash on windows Mar 2, 2021
@GwynethLlewelyn
Copy link

In your code above, you're just reading a single line — and stopping. As a consequence, you'll get a EOF, which is exactly what the package returns that.

I'm quite sure you forgot to enclose everything inside a for {...} loop...

@Silthus
Copy link

Silthus commented Aug 4, 2022

I have the same issue using https://github.com/manifoldco/promptui/ and it fails immediately with an EOF when using Git Bash. All other operations succeed.

Any idea how to workaround or fix it?

@johnjqc
Copy link

johnjqc commented May 19, 2023

I have the same problem, but if I run git bash from visual studio code, it works fine.

image

Is not a bug of this library, I found it crossterm-rs/crossterm#168

@mamh2021
Copy link

mamh2021 commented Nov 23, 2023

I have the same problem, I have the same issue using https://github.com/manifoldco/promptui/ .

but if I run git bash from idea/vscode, it works fine.

github-merge-queue bot pushed a commit to databricks/cli that referenced this issue Dec 18, 2023
## Changes

Likely due to fact that Git Bash does not correctly support ANSI escape
sequences, we cannot use `promptui` package there. See known issues:

- manifoldco/promptui#208
- chzyer/readline#191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants