MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / Update

Method Update

internal/ui/input.go:148–160  ·  view source on GitHub ↗
(msg tea.Msg)

Source from the content-addressed store, hash-verified

146func (m confirmModel) Init() tea.Cmd { return nil }
147
148func (m confirmModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
149 if key, ok := msg.(tea.KeyMsg); ok {
150 switch key.String() {
151 case "y", "Y":
152 m.answer = true
153 return m, tea.Quit
154 case "n", "N", "esc", "ctrl-c", "ctrl-d", "enter":
155 m.answer = false
156 return m, tea.Quit
157 }
158 }
159 return m, nil
160}
161
162func (m confirmModel) View() string {
163 return confirmMark.Render(" ? ") + m.prompt + hintStyle.Render(" (y/n) ")

Callers 1

UpdateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected