Repository navigation
Conversation
pietern
force-pushed
the
pietern/charm-v2/03c-key-changes
branch
from
November 17, 2026 22:30
b2b3610 to
78b2bf2
Compare
Collaborator
✅ Integration test reportCommit: 94fea4a
Top 40 slowest tests (at least 2 minutes):
|
Contributor
Author
|
/review |
| } | ||
|
|
||
| case tea.KeyMsg: | ||
| if in, ok := teainput.Decode(msg); ok { |
There was a problem hiding this comment.
The select model (line 256) and pager (line 186) both guard against paste before dispatching, but the table view doesn't. In normal mode a paste event has in.Key == "", so the updateNormal switch falls through and m.viewport.Update(msg) receives the raw tea.KeyMsg. If the viewport has a key binding that matches the pasted text (e.g. a single pasted "d" hitting HalfPageDown), it would scroll. Can we add a paste guard here like the other two models?
pietern
force-pushed
the
pietern/charm-v2/03c-key-changes
branch
from
November 18, 2026 13:07
78b2bf2 to
94fea4a
Compare
pietern
force-pushed
the
pietern/charm-v2/03c-key-changes
branch
from
November 18, 2026 15:55
94fea4a to
558222b
Compare
…paste as text These are the deliberate v1 behaviour changes, each with its golden rows: - Alt stays in the key name for every non-rune key, so Alt+Enter, Alt+arrows, Alt+Ctrl+C and Alt+Space match no case and do nothing in prompts, selection lists and the pager. v1 acted as the plain key, because it ignored Alt on those keys. Goldens: TestKeysPin_PromptAltEnter, TestKeysPin_PromptAltLeft, TestKeysPin_SelectAltEnter. - A paste in a selection list is literal search text when search is open and is ignored otherwise. v1 treated a paste like typed keys, so a pasted "j" moved the cursor and a pasted "/" opened search. Pinned by TestSelectPaste. - The table view's search takes Text, not msg.String(). v1 appended "alt+f" for Alt+F and "[text]" for a paste. Goldens: TestTableviewPin_SearchInput (search input and status line now read "match 1/10"). Changelog: .nextchanges/cli/alt-keys-inert.md. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
pietern
force-pushed
the
pietern/charm-v2/03c-key-changes
branch
from
November 18, 2026 16:08
558222b to
c254801
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
These are the deliberate v1 behaviour changes, each with its golden rows:
TestKeysPin_PromptAltEnter(typedabc, not submitted),TestKeysPin_PromptAltLeft(abcX),TestKeysPin_SelectAltEnter(the list stays on screen and a later Enter picksid-02).jmoved the cursor and a pasted/opened search. Unit test:TestSelectPaste.alt+ffor Alt+F and[text]for a paste. Golden:TestTableviewPin_SearchInput(search readsitem-1; status readsmatch 1/10).Changelog:
.nextchanges/cli/alt-keys-inert.md.Why
Alt+Enter submitting a prompt and Alt+Left moving the cursor were v1 side effects of ignoring Alt, not designed behaviour. No standard gives those keys a meaning, and on macOS Option sends Meta only with "Option as Meta". Making them inert also keeps the v2 key names unambiguous for the v2 swap.
Tests
go build ./..., golangci-lint (0 issues), gofmt clean.TERM=xterm-256color go test -race -count=3 ./libs/cmdio/... ./libs/tableview/...passes.TestKeysPin_PromptAltEnter/{01-after-alt-enter,02-result}:Value: abbecomes✔ Value: abc█.TestKeysPin_PromptAltLeft/{01-after-alt-left,02-result}:abXcbecomesabcX.TestKeysPin_SelectAltEnter/01-after-alt-enter: the list stays on screen.TestTableviewPin_SearchInput/{02-search-input,03-after-search.styled}:/ italt+f[em-1]█becomes/ item-1█;no matchesbecomesmatch 1/10.-update.go test ./acceptance/...) passes.Stack: based on
pietern/charm-v2/03b-teainput.Manual checks for real terminals:
databricks selftest tui prompt, typeab, Alt+Enter,c, Enter:Entered: abc(v1:Entered: ab).databricks selftest tui select --n 3, Alt+Enter: nothing happens; Enter selects the highlighted item.databricks selftest tui table --rows 50:/, Alt+F, then type: the search text has noalt+f.This pull request and its description were written by Isaac.