@@ -95,6 +95,26 @@ func (a App) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
9595 return a , tea .Quit
9696 }
9797 if a .pendingInput != nil {
98+ if componentsUsesVerticalPrompt (a .inputPrompt , a .pendingInput .Options ) {
99+ switch msg .Type {
100+ case tea .KeyUp :
101+ a .inputPrompt = a .inputPrompt .SetSelectedIndex (a .inputPrompt .SelectedIndex () - 1 )
102+ return a , nil
103+ case tea .KeyDown :
104+ a .inputPrompt = a .inputPrompt .SetSelectedIndex (a .inputPrompt .SelectedIndex () + 1 )
105+ return a , nil
106+ case tea .KeyEnter :
107+ idx := a .inputPrompt .SelectedIndex ()
108+ if idx >= 0 && idx < len (a .pendingInput .Options ) {
109+ opt := a .pendingInput .Options [idx ]
110+ a .lines = appendLine (a .lines , styledLine {text : formatResolvedInput (* a .pendingInput , opt .Key )})
111+ responseCmd := sendInputResponseCmd (a .pendingInput .ResponseCh , output.InputResponse {SelectedKey : opt .Key })
112+ a .pendingInput = nil
113+ a .inputPrompt = a .inputPrompt .Hide ()
114+ return a , responseCmd
115+ }
116+ }
117+ }
98118 if opt := resolveOption (a .pendingInput .Options , msg ); opt != nil {
99119 a .lines = appendLine (a .lines , styledLine {text : formatResolvedInput (* a .pendingInput , opt .Key )})
100120 responseCmd := sendInputResponseCmd (a .pendingInput .ResponseCh , output.InputResponse {SelectedKey : opt .Key })
@@ -296,6 +316,19 @@ func (a *App) flushBufferedLines() {
296316}
297317
298318func formatResolvedInput (req output.UserInputRequestEvent , selectedKey string ) string {
319+ // Special handling for lstk update prompt
320+ if len (req .Options ) > 0 && strings .Contains (req .Options [0 ].Label , "Update now" ) {
321+ checkmark := styles .Success .Render (output .SuccessMarker ())
322+ switch selectedKey {
323+ case "u" :
324+ return checkmark + " Updating lstk..."
325+ case "s" :
326+ return checkmark + " Skipped this version"
327+ case "n" :
328+ return checkmark + " Won't ask again"
329+ }
330+ }
331+
299332 formatted := output .FormatPrompt (req .Prompt , req .Options )
300333 firstLine := strings .Split (formatted , "\n " )[0 ]
301334
@@ -316,6 +349,10 @@ func formatResolvedInput(req output.UserInputRequestEvent, selectedKey string) s
316349 return fmt .Sprintf ("%s %s" , firstLine , selected )
317350}
318351
352+ func componentsUsesVerticalPrompt (prompt components.InputPrompt , options []output.InputOption ) bool {
353+ return prompt .Visible () && len (options ) > 1 && strings .Contains (options [0 ].Label , "[" )
354+ }
355+
319356// resolveOption finds the best matching option for a key event, in priority order:
320357// 1. "any" — matches any keypress
321358// 2. "enter" — matches the Enter key explicitly
0 commit comments