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

feat: add option to set a custom lipgloss renderer #403

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aymanbagabas
Copy link
Member

@aymanbagabas aymanbagabas commented Aug 3, 2023

Lip Gloss defaults to os.Stdout to detect the background color and color profile of the terminal. This can be a problem when the application is using a different output stream like os.Stderr or a remote session like in an SSH server.

When using an SSH server, usually the server provides to the session a $SSH_TTY environment variable pointing to the allocated PTY to be used for the application. The value of $SSH_TTY points to the terminal TTY
FD that should be used to run the application.

Starting with Lip Gloss v0.7, you can use custom renderers to specify a different Lip Gloss output to detect the background color and color profile. This PR adds the necessary "glue" to the Bubbles in order to change the renderer being used to detect the color profile and background.

// depending on the focus state.
//
// For an introduction to styling with Lip Gloss see:
// https://github.com/charmbracelet/lipgloss
type Style struct {
type Styles struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason for the change here other than aesthetics?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency with other bubbles. The type alias should take care of backward compatibility.

Lip Gloss defaults to `os.Stdout` to detect the background color and
color profile of the terminal. This can be a problem when the
application is using a different output stream like `os.Stderr` or a
remote session like in a SSH server.

When using an SSH server, usually the server provides to the session a
`$SSH_TTY` environment variable pointing to the allocated PTY to be used
for the application. The value of `$SSH_TTY` points to the terminal TTY
  FD that _should_ be used to run the application.

Starting with Lip Gloss v0.7, you can use custom renderers to specify a
different Lip Gloss output to detect the background color and color
profile. This PR adds the necessary "glue" to the Bubbles in order to
change the renderer being used to detect the color profile and
background.
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

Successfully merging this pull request may close these issues.

None yet

3 participants