prompt

package
v0.33.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func StartStatusLine

func StartStatusLine(url model.WebURL, host model.WebHost) string

Types

type OpenInput

type OpenInput func() (TerminalInput, error)

type SwitchTerminalModeAction

type SwitchTerminalModeAction struct {
	Mode store.TerminalMode
}

func (SwitchTerminalModeAction) Action

func (SwitchTerminalModeAction) Action()

type TerminalInput

type TerminalInput interface {
	ReadRune() (rune, error)
	Close() error
}

func TTYOpen

func TTYOpen() (TerminalInput, error)

type TerminalPrompt

type TerminalPrompt struct {
	// contains filtered or unexported fields
}

func NewTerminalPrompt

func NewTerminalPrompt(a *analytics.TiltAnalytics, openInput OpenInput,
	openURL openurl.OpenURL, stdout hud.Stdout,
	host model.WebHost, url model.WebURL) *TerminalPrompt

func (*TerminalPrompt) OnChange

func (*TerminalPrompt) SetInitOutput

func (p *TerminalPrompt) SetInitOutput(buf *bytes.Buffer)

Copy initial warnings and info logs from the logstore into the terminal prompt, so that they get shown as part of the prompt.

This sits at the intersection of two incompatible interfaces:

  1. The LogStore is an asynchronous, streaming log interface that makes sure all logs are shown everywhere (across stdout, hud, web, snapshots, etc).

  2. The TerminalPrompt is a synchronous interface that shows a deliberately short "greeting" message, then blocks on user input.

Rather than make these two interfaces interoperate well, we just have the internal/cli code copy over the logs during the init sequence. It's OK if logs show up twice.

func (*TerminalPrompt) TearDown

func (p *TerminalPrompt) TearDown(ctx context.Context)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL