Open shaunco opened 1 month ago
For now, I just call lipgloss.SetDefaultRenderer()
in teaHandler(s ssh.Session)
:
r := bubbletea.MakeRenderer(s)
lipgloss.SetDefaultRenderer(r)
But since this is setting a global default renderer, it means that different ssh clients can cause this to change mid-ssh session.
Is your feature request related to a problem? Please describe. The current method for passing the Wish renderer to the various styles in huh is clunky, in that you call one of the theme functions (like
huh.ThemeBase()
), then go back and replace the renderer anywhere there are colors, as shown: https://github.com/charmbracelet/huh/blob/dad719087fe0db3f002e02328936e12b55733379/examples/ssh-form/main.go#L78-L93In addition to being awkward, it also means that any new styles added to huh must be added to the code that calls
ThemeBase()
and then swaps out styles.Describe the solution you'd like A new set of functions that accept a renderer should be added (
huh.ThemeBaseWithRenderer()
,huh.ThemeCharmWithRenderer
, etc), and then the current functions can simply passlipgloss.DefaultRenderer()
to the new functions, such as: