[1.0 Review] keymap / Action / chord grammar と pipe/capture/run 分離の凍結 #8
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis#8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
felis の入力は
felis-client-coreのAction/IpcActionという closed enum と、[keymap]の chord→BindingValue解決で構成される。explanation/input.mdに「Action mapping」「Keybinding design」「A menu instead of a prefix」が仕様化。chord は単一ストローク(ctrl+shift+f等)でunbindsentinel で default を除去。現状の問題 / 凍結前に決めるべき点
1. 単一ストロークのみ、prefix / leader 無し
現行: multi-stroke(
ctrl+space, ctrl+wのような tmux prefix)は非対応。input.mdで「runをfzfメニューに束ねることで prefix の代替とする」設計。問い: 1.0 で単一ストロークを凍結するか? 将来
prefixを追加するとkeymapの value がchordからchords[]に破壊的変更が必要。今ならkeymap = [{chords: ["ctrl+space", "w"], kind: "detach"}]のような配列形にできる。現行の「単一ストローク +
runメニュー」でもswitch_sessionのPrevious/Next巡回(roster 取得→creation order で step)は leader 無しで tab-like に動くが、大量 session を持つユーザには直接 jump の UX が弱い。2.
unbindsentineldefault を除去する sentinel
kind = "unbind"は、TOML 上で{kind="unbind"}という typed value として表現される。BindingValue::Unbindはinto_action() -> Noneで dispatcher の fall-through にする。代替:
keymap."ctrl+shift+r" = false/nullのような簡潔な除去記法。現行の typed sentinel は、将来keymapの value がAction以外(例:mode)に拡張された時に拡張しやすい利点がある。1.0 で sentinel 形を凍結するか。3. chord grammar の strictness
ctrl/shift/alt/superの4つのみ(control/cmd/win/escは unknown token で拒否)。enter/tab/escape/space/backspace/insert/delete/home/end/page_up/page_down/up/down/left/right/f1..f35のみ。shift+avsshift+A)。ctrl+ctrl+a)は config error。この「一つの綴りのみ」原則は typo 検出に強いが、他 terminal からの移行時に
cmd/controlを書いてしまう罠になる。1.0 で alias(cmd→super)を許容するか、現行の厳密さを凍結するか。4. closed Action enum
ActionはSendString, Paste, Copy, Reload, Detach, FontSize, Scroll*, ScrollToPrompt, ToggleFullscreen, Ipc(IpcAction), Pipe, Runの closed set。IpcActionもSwitchSession, KillSession, OpenScrollbackSearch, NewSessionの closed set。variant は typed param を持ち、expression / callback を持たない(principle 1)。PipeとRunはRegionSource/PipeTarget/command: Vec<String>の typed union。SendStringはtext+escapes: c_style|noneでescapes.decode()の検証を伴う。問い: 1.0 で Action set を凍結し、将来の追加は minor 扱い(additive)にするか? 新 Action が wire の
RegionMsg/SessionMsg::Createに依存する場合は、control surface と wire の両方に跨る変更になるため、1.0 で「Action 追加は必ず wire 追加を伴う」規則をcontrol-surfaces.mdに明記すべき。5.
pipevscapturevsrunの分離pipe(keymap-only): region → sink(command/clipboard/file/temp_file/paste)の push。capture(CLI-only): region → stdout の pull。run(keymap-only): region 無しで command を transient session で実行。control-surfaces.mdの「Deliberate asymmetries」で「pipeは keymap-only,captureは CLI-only」は意図的とされている。1.0 でこの push/pull 分離を凍結するか、将来sessions pipe(headless で region を sink に送る)やkeymap capture(keymap から stdout 的な sink)を許すか。6. mouse / wheel / IME
mouse.scroll_multiplierは0.1..=100.0に clamp、touchpad smooth scroll は velocity-scaled で無視。Ctrl+Wheelは font zoom で scroll と latch。IME は winit 経由(macOS native / Wayland zwp_text_input_v3 / X11 XIM / Windows TSF)。1.0 で mouse gesture(select/dismiss/PRIMARY auto-copy/middle-click paste)のデフォルトを凍結するか、将来的に
mouse節で gesture を config 可能にする余地を残すか。提案
explanation/input.mdの「Keybinding design」に「なぜ prefix を持たないか」の Revisit trigger(例: 100 session を持つユーザが direct jump を要望したら)を明記。cmd/control)を 1.0 で追加しないなら、reference/keybindings.mdの quick facts に「なぜ alias が無いか」を追記し、将来の alias 追加は additive だが敢えてしない決定として記録。reference/spec.mdの REQ-806 / 806a に「1.0 で凍結、追加は minor」としてラベル付け。判定基準
felis config checkが malformed chord / unknown kind / malformed binding args を全てdiagnosticsで報告し、一つの bad entry が他の entry を巻き込まないこと。cc @natsukium
Resolved by the later review in #12: keep typed Action/BindingValue surfaces and the existing no-evaluator, no-prefix product boundary. No release-breaking keymap redesign was selected; future proposals should be filed against an observed need.