The open source coding agent.
TypeScript
patch for scroll dumping characters into input buffer
Dax Raad322385f6b143
diff --git a/packages/tui/internal/tui/tui.go b/packages/tui/internal/tui/tui.goindex 89a34e35153..6dde8da168d 100644--- a/packages/tui/internal/tui/tui.go+++ b/packages/tui/internal/tui/tui.go@@ -56,6 +56,7 @@ type appModel struct {isLeaderSequence booltoastManager *toast.ToastManagerinterruptKeyState InterruptKeyState+ lastScroll time.Time}func (a appModel) Init() tea.Cmd {@@ -81,12 +82,32 @@ func (a appModel) Init() tea.Cmd {return tea.Batch(cmds...)}+var BUGGED_SCROLL_KEYS = map[string]bool{+ "0": true,+ "1": true,+ "2": true,+ "3": true,+ "4": true,+ "5": true,+ "6": true,+ "7": true,+ "8": true,+ "9": true,+ "M": true,+ "m": true,+ "[": true,+ ";": true,+}+func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {var cmds []tea.Cmdswitch msg := msg.(type) {case tea.KeyPressMsg:keyString := msg.String()+ if time.Since(a.lastScroll) < time.Millisecond*100 && BUGGED_SCROLL_KEYS[keyString] {+ return a, nil+ }// 1. Handle active modalif a.modal != nil {@@ -222,6 +243,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {a.editor = updatedEditor.(chat.EditorComponent)return a, cmdcase tea.MouseWheelMsg:+ a.lastScroll = time.Now()if a.modal != nil {return a, nil}