Repository navigation
fix(keymap): rebind file picker from ctrl+p to P - #300
Merged
Merged
Conversation
host terminals claim ctrl+p before it reaches the TUI — agterm binds it to session_palette by default — so the file picker was unreachable there and read as a missing feature rather than a conflict. P is printable, and the picker's handleKey runs appendPrintableRunes before the action checks, so P inside an open picker extends the filter instead of closing it. That ordering has to stay: reversing it would break filtering for whichever bare printable keys are bound to jump_file, up or down — P/j/k by default, and any bare printable key a user maps to those actions. Toggle-close remains available through any non-printable binding (map alt+f jump_file, map f1 jump_file, a ctrl chord).
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.
the file picker from #285 was bound to
ctrl+p, which host terminals claim before it reaches the TUI. Agterm binds it tosession_paletteby default, so inside agterm the picker could not be opened at all and read as a missing feature rather than a shadowed key. Moved the default toP.one line of production code in
app/keymap/keymap.go, the rest is tests and docs.the trade-off with a printable key
filePickerOverlay.handleKeyrunsappendPrintableRunesbefore the action checks, and that consumes every unmodified printable rune regardless of what it resolves to. SoPinside an open picker extends the filter instead of closing it, and theActionJumpFileclose branch is unreachable for the default binding.that ordering has to stay. Reversing it would break filtering for whichever bare printable keys are bound to
jump_file,upordown,P/j/kby default plus any bare printable key a user maps to those actions.Esccloses the picker, and toggle-close still works through any non-printable binding (map alt+f jump_file,map f1 jump_file, a ctrl chord).tests
TestModel_JumpFileToggleClosesPickerno longer describes the default behavior, so it was replaced by two tests rather than dropped.TestModel_JumpFileKeyFiltersInsideOpenPickerpins thatPfilters andEnterselects the narrowed match,TestModel_JumpFileModifiedChordTogglesClosesPickerpins thatalt+fstill toggles closed. AddedTestActionJumpFile_NotBoundToCtrlPso the default cannot drift back onto a chord host terminals take, andTestModel_SearchPrompt_SwallowsJumpFileKeyso a capital P typed into the search prompt stays text.known limitation, not introduced here
bubbletea batches consecutive printable runes from one terminal read into a single
KeyRunesmessage (key.go:696), andKey.String()returns the concatenation. TypingPplus filter text fast enough to land in one read resolves to no action and drops the keystroke. This already affects every printable binding in the app (j,k,a,v,C,w,t);ctrl+pwas immune only because control sequences parse separately. Fixing it means splitting multi-rune messages in the dispatcher, which is a separate change with its own tests.users who have
unmap ctrl+pin their keybindings will pick upPas a new default.unmap Psuppresses it.Related to #284