MCPcopy Create free account

hub / github.com/charmbracelet/bubbletea / functions

Functions758 in github.com/charmbracelet/bubbletea

↓ 73 callersMethodRun
Run initializes the program and runs its event loops, blocking until it gets terminated by either [Program.Quit], [Program.Kill], or its signal handle
tea.go:1039
↓ 55 callersMethodString
()
examples/send-msg/main.go:31
↓ 48 callersMethodRun
()
exec.go:61
↓ 43 callersMethodRender
(w io.Writer, m list.Model, index int, listItem list.Item)
examples/list-simple/main.go:47
↓ 42 callersFunctionNewProgram
NewProgram creates a new [Program].
tea.go:625
↓ 40 callersMethodPrintln
Println prints above the Program. This output is unmanaged by the program and will persist across renders by the Program. If the altscreen is active
tea.go:1498
↓ 40 callersFunctionWithInput
WithInput sets the input which, by default, is stdin. In most cases you won't need to use this. To disable input entirely pass nil. p := NewProgram(
options.go:47
↓ 39 callersFunctionWithOutput
WithOutput sets the output which, by default, is stdout. In most cases you won't need to use this.
options.go:30
↓ 36 callersMethodView
View renders the program's UI, which can be a string or a [Layer]. The view is rendered after every Update.
tea.go:64
↓ 35 callersMethodUpdate
Update is called when a message is received. Use it to inspect messages and, in response, update the model and/or send a command.
tea.go:60
↓ 32 callersMethodSend
Send sends a message to the main update function, effectively allowing messages to be injected from outside the program for interoperability purposes.
tea.go:1280
↓ 26 callersMethodString
String implements [fmt.Stringer] and is quite useful for matching key events. It will return the textual representation of the [Key] if there is one,
key.go:351
↓ 24 callersMethodPrintf
Printf prints above the Program. It takes a format template followed by values similar to fmt.Printf. This output is unmanaged by the program and will
tea.go:1513
↓ 23 callersFunctionNewView
NewView is a helper function to create a new [View] with the given styled string. A styled string represents text with styles and hyperlinks encoded a
tea.go:76
↓ 19 callersMethodHeight
()
examples/list-simple/main.go:44
↓ 15 callersFunctionnewCursedRenderer
(w io.Writer, env []string, width, height int)
cursed_renderer.go:43
↓ 13 callersMethodflush
flush flushes the renderer's buffer to the output. It reports whether there was anything to draw, so the caller can tell an idle screen from an active
renderer.go:31
↓ 13 callersMethodrender
render renders a frame to the output.
renderer.go:26
↓ 12 callersFunctionWithContext
WithContext lets you specify a context in which to run the Program. This is useful if you want to cancel the execution from outside. When a Program ge
options.go:22
↓ 11 callersMethodError
()
examples/http/main.go:25
↓ 11 callersMethodQuit
Quit is a convenience function for quitting Bubble Tea programs. Use it when you need to shut down a Bubble Tea program from the outside. If you wish
tea.go:1294
↓ 11 callersMethodSetContent
SetContent is a helper method to set the content of a [View] with a styled string. A styled string represents text with styles and hyperlinks encoded
tea.go:293
↓ 10 callersMethodGetenv
Getenv returns the value of the environment variable named by the key. If the variable is not present in the environment, the value returned will be t
environ.go:24
↓ 10 callersMethodLen
()
renderer_park_test.go:32
↓ 9 callersMethodString
()
examples/cellbuffer/main.go:118
↓ 9 callersMethodstart
start starts the renderer.
renderer.go:20
↓ 8 callersMethodIsDark
IsDark returns whether the color is dark.
color.go:93
↓ 7 callersMethodCursor
()
examples/autocomplete/main.go:122
↓ 7 callersFunctionWithEnvironment
WithEnvironment sets the environment variables that the program will use. This useful when the program is running in a remote session (e.g. SSH) and y
options.go:65
↓ 7 callersFunctionWithWindowSize
WithWindowSize sets the initial size of the terminal window. This is useful when you need to set the initial size of the terminal window, for example
options.go:170
↓ 6 callersMethodInit
Init is the first function that will be called. It returns an optional initial command. To not perform an initial command return nil.
tea.go:56
↓ 6 callersMethodKill
Kill stops the program immediately and restores the former terminal state. The final render that you would normally see when quitting will be skipped.
tea.go:1308
↓ 6 callersFunctionWithoutRenderer
WithoutRenderer disables the renderer. When this is set output and log statements will be plainly sent to stdout (or another output if one is set) wit
options.go:105
↓ 5 callersMethodKey
Key returns the underlying key event.
key.go:263
↓ 5 callersMethodMouse
Mouse returns the underlying mouse event.
mouse.go:50
↓ 5 callersMethodWrite
(p []byte)
renderer_park_test.go:26
↓ 5 callersFunctionawaitQuitLifecycle
(t *testing.T, done <-chan struct{}, operation string)
quit_lifecycle_test.go:32
↓ 5 callersMethodclose
close closes the renderer and flushes any remaining data.
renderer.go:23
↓ 5 callersMethodsetWidthMethod
setWidthMethod sets the method for calculating the width of the terminal.
renderer.go:43
↓ 4 callersMethodString
String returns a string representation of the mouse message.
mouse.go:78
↓ 4 callersMethodWait
Wait waits/blocks until the underlying Program finished shutting down.
tea.go:1318
↓ 4 callersFunctionWithFPS
WithFPS sets a custom maximum FPS at which the renderer should run. If less than 1, the default value of 60 will be used. If over 120, the FPS will be
options.go:149
↓ 4 callersMethodinsertAbove
insertAbove inserts unmanaged lines above the renderer.
renderer.go:37
↓ 4 callersFunctionkeyboardEnhancementsFlags
(ke KeyboardEnhancements)
cursed_renderer.go:977
↓ 4 callersFunctionmin
(a, b int)
examples/capability/main.go:71
↓ 4 callersMethodshutdown
shutdown performs operations to free up resources and restore the terminal to its original state.
tea.go:1367
↓ 3 callersFunctionBatch
Batch performs a bunch of commands concurrently with no ordering guarantees about the results. Use a Batch to return several commands. Example: fun
commands.go:15
↓ 3 callersFunctionExecProcess
ExecProcess runs the given *exec.Cmd in a blocking fashion, effectively pausing the Program while the command is running. After the *exec.Cmd exists t
exec.go:50
↓ 3 callersFunctionQuit
Quit is a special command that tells the Bubble Tea program to exit.
tea.go:585
↓ 3 callersMethodRestoreTerminal
RestoreTerminal reinitializes the Program's input reader, restores the terminal to the former state when the program was running, and repaints. Use it
tea.go:1469
↓ 3 callersMethodTitle
()
examples/list-fancy/main.go:40
↓ 3 callersFunctionWithoutSignals
WithoutSignals will ignore OS signals. This is mainly useful for testing.
options.go:91
↓ 3 callersFunctionassertInOrder
(t *testing.T, got string, wants ...string)
cursed_renderer_test.go:230
↓ 3 callersMethodcheckResize
checkResize detects the current size of the output and informs the program via a WindowSizeMsg.
tty.go:159
↓ 3 callersFunctionenableAltScreen
enableAltScreen sets the alt screen mode. Note that this writes to the buffer directly if write is true.
cursed_renderer.go:742
↓ 3 callersFunctionencodeCursorStyle
encodeCursorStyle returns the integer value for the given cursor style and blink state.
renderer.go:105
↓ 3 callersMethodfallbackDimensions
fallbackDimensions returns width and height, falling back to COLUMNS/LINES environment variables or 80x24 defaults when dimensions are non-positive.
tty.go:127
↓ 3 callersMethodflush
flush flushes the output buffer to the program output.
tea.go:1347
↓ 3 callersFunctionnewParkHarness
(t *testing.T, fps int, opts ...ProgramOption)
renderer_park_test.go:100
↓ 3 callersMethodreleaseTerminal
(reset bool)
tea.go:1449
↓ 3 callersFunctionreset
(s *cursedRenderer)
cursed_renderer.go:675
↓ 3 callersMethodresize
resize notify the renderer of a terminal resize.
renderer.go:46
↓ 3 callersMethodrestoreTerminalState
restoreTerminalState restores the terminal to the state prior to running the Bubble Tea program.
tty.go:34
↓ 3 callersFunctiontick
()
examples/views/main.go:56
↓ 3 callersMethodwaitForReadLoop
waitForReadLoop waits for the cancelReader to finish its read loop.
tty.go:110
↓ 3 callersMethodwaitParked
waitParked waits until the renderer has stopped ticking.
renderer_park_test.go:135
↓ 3 callersMethodwindowView
()
examples/clickable/main.go:307
↓ 2 callersFunctionExec
Exec is used to perform arbitrary I/O in a blocking fashion, effectively pausing the Program while execution is running and resuming it when execution
exec.go:22
↓ 2 callersMethodKeystroke
Keystroke returns the keystroke representation of the [Key]. While less type safe than looking at the individual fields, it will usually be more conve
key.go:369
↓ 2 callersFunctionLogToFileWith
LogToFileWith does allows to call LogToFile with a custom LogOptionsSetter.
logging.go:36
↓ 2 callersMethodLookupEnv
LookupEnv retrieves the value of the environment variable named by the key. If the variable is present in the environment the value (which may be empt
environ.go:32
↓ 2 callersMethodReleaseTerminal
ReleaseTerminal restores the original terminal state and cancels the input reader. You can return control to the Program with RestoreTerminal.
tea.go:1445
↓ 2 callersFunctionSequence
Sequence runs the given commands one at a time, in order. Contrast this with Batch, which runs commands concurrently.
commands.go:25
↓ 2 callersMethodSetOutput
(io.Writer)
logging.go:31
↓ 2 callersMethodString
String returns the hex representation of the color.
color.go:88
↓ 2 callersMethodString
()
examples/set-terminal-color/main.go:22
↓ 2 callersMethodSupportsEventTypes
SupportsEventTypes returns whether the terminal supports reporting different types of key events (press, release, and repeat).
keyboard.go:39
↓ 2 callersFunctionWithColorProfile
WithColorProfile sets the color profile that the program will use. This is useful when you want to force a specific color profile. By default, Bubble
options.go:160
↓ 2 callersFunctionWithFilter
WithFilter supplies an event filter that will be invoked before Bubble Tea processes a tea.Msg. The event filter can return any tea.Msg which will the
options.go:140
↓ 2 callersFunctionanimate
()
examples/cellbuffer/main.go:131
↓ 2 callersMethodcanFindBook
canFindBook returns whether the find button is to be pressed
examples/isbn-form/main.go:42
↓ 2 callersMethodcheckOptimizedMovements
(s *term.State)
termios_bsd.go:11
↓ 2 callersFunctionclamp
(n, min, max int)
examples/clickable/main.go:361
↓ 2 callersMethodcount
count returns the number of ticks so far.
renderer_park_test.go:64
↓ 2 callersFunctiondownloadAndInstall
(pkg string)
examples/package-manager/main.go:117
↓ 2 callersFunctionenableTextCursor
enableTextCursor sets the text cursor mode.
cursed_renderer.go:771
↓ 2 callersMethodexecBatchMsg
(msg BatchMsg)
tea.go:966
↓ 2 callersMethodexecSequenceMsg
(msg sequenceMsg)
tea.go:940
↓ 2 callersMethodexecute
execute writes the given sequence to the program output.
tea.go:1323
↓ 2 callersMethodexecuteQuery
executeQuery writes a terminal query to the program output. Queries expect a reply on p.input, so when input is disabled the query is skipped: the pro
tea.go:1339
↓ 2 callersMethodfooterView
()
examples/pager/main.go:112
↓ 2 callersFunctionframe
()
examples/views/main.go:62
↓ 2 callersMethodhandleSignals
()
tea.go:672
↓ 2 callersMethodheaderView
()
examples/autocomplete/main.go:181
↓ 2 callersMethodheaderView
()
examples/pager/main.go:106
↓ 2 callersMethodinit
(w, h int)
examples/cellbuffer/main.go:79
↓ 2 callersMethodinitInputReader
initInputReader (re)commences reading inputs.
tty.go:57
↓ 2 callersMethodinitTerminal
()
tty.go:25
↓ 2 callersMethodinputViews
()
examples/split-editors/main.go:188
↓ 2 callersFunctionisPlausibleWindowSize
(width, height int)
screen.go:73
next →1–100 of 758, ranked by callers