Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(bth Handler) wish.Middleware
Middleware takes a Handler and hooks the input and output for the ssh.Session into the tea.Program. It also captures window resize events and sends them to the tea.Program as tea.WindowSizeMsgs. By default a 256 color profile will be used when rendering with Lip Gloss.
func MiddlewareWithColorProfile ¶
func MiddlewareWithColorProfile(bth Handler, cp termenv.Profile) wish.Middleware
MiddlewareWithColorProfile allows you to specify the number of colors returned by the server when using Lip Gloss. The number of colors supported by an SSH client's terminal cannot be detected by the server but this will allow for manually setting the color profile on all SSH connections.
func MiddlewareWithProgramHandler ¶ added in v0.3.1
func MiddlewareWithProgramHandler(bth ProgramHandler, cp termenv.Profile) wish.Middleware
MiddlewareWithProgramHandler allows you to specify the ProgramHandler to be able to access the underlying tea.Program. This is useful for creating custom middlewars that need access to tea.Program for instance to use p.Send() to send messages to tea.Program.
Make sure to set the tea.WithInput and tea.WithOutput to the ssh.Session otherwise the program will not function properly.
Types ¶
type BubbleTeaHandler
deprecated
type BubbleTeaHandler = Handler // nolint: revive
BubbleTeaHandler is the function Bubble Tea apps implement to hook into the SSH Middleware. This will create a new tea.Program for every connection and start it with the tea.ProgramOptions returned.
Deprecated: use Handler instead.
type Handler ¶ added in v0.2.0
Handler is the function Bubble Tea apps implement to hook into the SSH Middleware. This will create a new tea.Program for every connection and start it with the tea.ProgramOptions returned.
type ProgramHandler ¶ added in v0.3.1
ProgramHandler is the function Bubble Tea apps implement to hook into the SSH Middleware. This should return a new tea.Program. This handler is different from the default handler in that it returns a tea.Program instead of (tea.Model, tea.ProgramOptions).
Make sure to set the tea.WithInput and tea.WithOutput to the ssh.Session otherwise the program will not function properly.