Skip to content

Automatically set correct color profile #172

@antonmedv

Description

@antonmedv

I want to create something like fzf. The fzf renders to stderr, while returning content to stdour.
So next is possible (fzf will open interactive TUI):

fzf | cat

But termenv do this by default:

func ColorProfile() Profile {
	if !isatty.IsTerminal(os.Stdout.Fd()) {
		return Ascii
	}

	return colorProfile()
}

I know what I can manually call lipgloss.SetColorProfile, but it will be cool if creating stderr apps will be easy, and the next code just work:

p := tea.NewProgram(m, tea.WithOutput(os.Stderr))

But now I need to copy-paste colorProfile() logic to be able to detect the correct profile.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions