Skip to content
Myr

chore: revert "chore: deprecate some StartupOptions in favor of Cmds (#1307)"

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This reverts commit 75d1b4b8cf8af027c68a171fc386aca90a02f2a6.

authored by Ayman Bagabas · committed by Ayman Bagabas · parent ee7cf45 · Browse files · 2 files+14 added−40 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−40 removed

  • other:+14 added−40 removed

2 files+14 added−40 removed

modified:options.go-17 removed
104 unmodified lines
105// }106//107// To enter the altscreen once the program has already started running use the108// EnterAltScreen command.109//110// Deprecated: use the [EnterAltScreen] [Cmd] in your [Model.Init] instead.109func WithAltScreen() ProgramOption {110 return func(p *Program) {111 p.startupOptions |= withAltScreen112 }113}114115// WithoutBracketedPaste starts the program with bracketed paste disabled.118//119// Deprecated: use the [EnableBracketedPaste] [Cmd] in your [Model.Init]120// instead.116func WithoutBracketedPaste() ProgramOption {117 return func(p *Program) {118 p.startupOptions |= withoutBracketedPaste119 }
13 unmodified lines
133// the EnableMouseCellMotion command. To disable the mouse when the program is134// running use the DisableMouse command.135//136// The mouse will be automatically disabled when the program exits.142//143// Deprecated: use the [EnableMouseCellMotion] [Cmd] in your [Model.Init]144// instead.137func WithMouseCellMotion() ProgramOption {138 return func(p *Program) {139 p.startupOptions |= withMouseCellMotion // set140 p.startupOptions &^= withMouseAllMotion // clear
17 unmodified lines
158// EnableMouseAllMotion command. To disable the mouse when the program is159// running use the DisableMouse command.160//161// The mouse will be automatically disabled when the program exits.170//171// Deprecated: use the [EnableMouseAllMotion] [Cmd] in your [Model.Init]172// instead.162func WithMouseAllMotion() ProgramOption {163 return func(p *Program) {164 p.startupOptions |= withMouseAllMotion // set165 p.startupOptions &^= withMouseCellMotion // clear
21 unmodified lines
187// of this package.188//189// Deprecated: this incurs a noticeable performance hit. A future release will190// optimize ANSI automatically without the performance penalty.202//203// Deprecated: this will be removed in a future release. This ANSI compressor204// has major performance implications and we don't recommend using it. In v2,205// rendering bandwidth will be decreased significantly.191func WithANSICompressor() ProgramOption {192 return func(p *Program) {193 p.startupOptions |= withANSICompressor194 }
49 unmodified lines
244//245// Note that while most terminals and multiplexers support focus reporting,246// some do not. Also note that tmux needs to be configured to report focus247// events.263//264// Deprecated: use the [EnableReportFocus] [Cmd] in your [Model.Init] instead.248func WithReportFocus() ProgramOption {249 return func(p *Program) {250 p.startupOptions |= withReportFocus251 }
1 unmodified line
modified:screen.go+14 added-23 removed
22 unmodified lines
23// You can send a clearScreenMsg with ClearScreen.24type clearScreenMsg struct{}2526// EnterAltScreen is a special command that tells the Bubble Tea program to27// enter the alternate screen buffer (i.e. the full terminal window). The28// altscreen will be automatically exited when the program quits. To manually29// exit the altscreen while the program is running, use [ExitAltScreen].27// enter the alternate screen buffer.28//29// Because commands run asynchronously, this command should not be used in your30// model's Init function. To initialize your program with the altscreen enabled31// use the WithAltScreen ProgramOption instead.
16 unmodified lines
48 return exitAltScreenMsg{}49}5051// exitAltScreenMsg in an internal message signals that the program should exit54// alternate screen buffer. You can send a exitAltScreenMsg with55// [ExitAltScreen].52// alternate screen buffer. You can send a exitAltScreenMsg with ExitAltScreen.53type exitAltScreenMsg struct{}5455// EnableMouseCellMotion is a special command that enables mouse click,56// release, and wheel events. Mouse movement events are also captured if57// a mouse button is pressed (i.e., drag events).58//59// Because commands run asynchronously, this command should not be used in your63// model's Init function. Use the [WithMouseCellMotion] [ProgramOption]64// instead.60// model's Init function. Use the WithMouseCellMotion ProgramOption instead.61func EnableMouseCellMotion() Msg {62 return enableMouseCellMotionMsg{}63}64
6 unmodified lines
71// wheel, and motion events, which are delivered regardless of whether a mouse72// button is pressed, effectively enabling support for hover interactions.73//74// Many modern terminals support this, but not all. If in doubt, use79// [EnableMouseCellMotion] instead.75// EnableMouseCellMotion instead.76//77// Because commands run asynchronously, this command should not be used in your78// model's Init function. Use the WithMouseAllMotion ProgramOption instead.79func EnableMouseAllMotion() Msg {
27 unmodified lines
107type hideCursorMsg struct{}108109// ShowCursor is a special command for manually instructing Bubble Tea to show110// the cursor.115//116// Deprecated: this will be removed in a future release. In v2, the cursor will117// can be manged via a dedicated API.111func ShowCursor() Msg {112 return showCursorMsg{}113}114
1 unmodified line
116// this message with ShowCursor.117type showCursorMsg struct{}118119// EnableBracketedPaste is a special command that tells the Bubble Tea program127// to accept bracketed paste input. To disable bracketed paste, use128// [DisableBracketedPaste].120// to accept bracketed paste input.121//130// Also note that bracketed paste will be automatically disabled when the122// Note that bracketed paste will be automatically disabled when the123// program quits.124func EnableBracketedPaste() Msg {125 return enableBracketedPasteMsg{}126}
3 unmodified lines
130// enableBracketedPasteMsg with EnableBracketedPaste.131type enableBracketedPasteMsg struct{}132133// DisableBracketedPaste is a special command that tells the Bubble Tea program142// to accept bracketed paste input. To enable bracketed paste, use143// [EnableBracketedPaste].134// to accept bracketed paste input.135//145// Also note that bracketed paste will be automatically disabled when the136// Note that bracketed paste will be automatically disabled when the137// program quits.138func DisableBracketedPaste() Msg {139 return disableBracketedPasteMsg{}140}141151// disableBracketedPasteMsg in an internal message signals that bracketed paste152// should be disabled. You can send an disableBracketedPasteMsg with153// DisableBracketedPaste.142// disableBracketedPasteMsg in an internal message signals that143// bracketed paste should be disabled. You can send an144// disableBracketedPasteMsg with DisableBracketedPaste.145type disableBracketedPasteMsg struct{}146147// enableReportFocusMsg is an internal message that signals to enable focus148// reporting. You can send an enableReportFocusMsg with EnableReportFocus.
17 unmodified lines
166167// EnterAltScreen enters the alternate screen buffer, which consumes the entire168// terminal window. ExitAltScreen will return the terminal to its former state.169//179// Deprecated: Use the [EnterAltScreen] [Cmd] instead.170// Deprecated: Use the WithAltScreen ProgramOption instead.171func (p *Program) EnterAltScreen() {172 if p.renderer != nil {173 p.renderer.enterAltScreen()174 } else {
14 unmodified lines
189190// EnableMouseCellMotion enables mouse click, release, wheel and motion events191// if a mouse button is pressed (i.e., drag events).192//202// Deprecated: Use the [EnableMouseCellMotion] [Cmd] instead.193// Deprecated: Use the WithMouseCellMotion ProgramOption instead.194func (p *Program) EnableMouseCellMotion() {195 if p.renderer != nil {196 p.renderer.enableMouseCellMotion()197 } else {
16 unmodified lines
214// EnableMouseAllMotion enables mouse click, release, wheel and motion events,215// regardless of whether a mouse button is pressed. Many modern terminals216// support this, but not all.217//227// Deprecated: Use the [EnableMouseAllMotion] [Cmd] instead.218// Deprecated: Use the WithMouseAllMotion ProgramOption instead.219func (p *Program) EnableMouseAllMotion() {220 if p.renderer != nil {221 p.renderer.enableMouseAllMotion()222 } else {
26 unmodified lines