Skip to content

Commit 4ca84a2

Browse files
rebeliceclaude
andcommitted
fix: enable clipboard paste (Ctrl+V) in text input components
The textinput component's paste functionality is asynchronous - when Ctrl+V is pressed, it returns a Paste command that reads from clipboard and returns an internal pasteMsg. This message needs to be forwarded back to textinput.Update() to actually insert the text. Previously, only tea.KeyMsg was routed to input components, so pasteMsg was never delivered. Added a default case in App.Update() to forward unhandled messages to active textinput-based components (ConnectionDialog and SearchInput). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0dda792 commit 4ca84a2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

internal/app/app.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,20 @@ func (a *App) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
13841384
a.state.Width = msg.Width
13851385
a.state.Height = msg.Height
13861386
a.updatePanelDimensions()
1387+
1388+
default:
1389+
// Forward other messages (like textinput's internal pasteMsg) to active input components
1390+
// This enables clipboard paste functionality (Ctrl+V) in text inputs
1391+
// Only components that use charmbracelet/bubbles/textinput need these messages
1392+
var cmd tea.Cmd
1393+
if a.showConnectionDialog {
1394+
a.connectionDialog, cmd = a.connectionDialog.Update(msg)
1395+
return a, cmd
1396+
}
1397+
if a.showSearch {
1398+
a.searchInput, cmd = a.searchInput.Update(msg)
1399+
return a, cmd
1400+
}
13871401
}
13881402
return a, nil
13891403
}

0 commit comments

Comments
 (0)