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

Support colorful prompt #135

Closed
jievince opened this issue Aug 19, 2020 · 2 comments
Closed

Support colorful prompt #135

jievince opened this issue Aug 19, 2020 · 2 comments

Comments

@jievince
Copy link

liner doesn't support colorful prompt now:

func (s *State) PromptWithSuggestion(prompt string, text string, pos int) (string, error) {
	for _, r := range prompt {
		if unicode.Is(unicode.C, r) {
			return "", ErrInvalidPrompt
		}
	}

Why liner doesn't prompt like \033[31;1m\033[0m ?

@jievince
Copy link
Author

@peterh

@peterh
Copy link
Owner

peterh commented Aug 19, 2020

Liner doesn't support \033 because it's not portable. Specifically, Windows doesn't support VT102 escape sequences. It has a completely different API.

If you want colour, you want something more powerful (and less opinionated) than liner.

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

2 participants