Split recording_json helpers and add kitty extended-key integration tests#33
Conversation
Agent-Logs-Url: https://github.com/HalFrgrd/evp/sessions/1a5f90b4-ff83-494d-b182-9dc93290d7fe Co-authored-by: HalFrgrd <4559349+HalFrgrd@users.noreply.github.com>
Agent-Logs-Url: https://github.com/HalFrgrd/evp/sessions/1a5f90b4-ff83-494d-b182-9dc93290d7fe Co-authored-by: HalFrgrd <4559349+HalFrgrd@users.noreply.github.com>
Agent-Logs-Url: https://github.com/HalFrgrd/evp/sessions/1a5f90b4-ff83-494d-b182-9dc93290d7fe Co-authored-by: HalFrgrd <4559349+HalFrgrd@users.noreply.github.com>
| kind: &'static str, | ||
| } | ||
|
|
||
| fn decode_key(seq: &[u8]) -> KeyInfo { |
There was a problem hiding this comment.
You'll want to use crossterm events feature flags. The you can just use event poll to get a KeyEvent and print that
There was a problem hiding this comment.
Updated in c5ac71d: kitty_key_debug now uses crossterm event::poll + event::read and prints from KeyEvent directly. No UI screenshot (CLI/test-only change).
| "expected key debug app readiness" | ||
| ); | ||
| assert!( | ||
| haystack.contains("codepoint=13") && haystack.contains("mods=CTRL"), |
There was a problem hiding this comment.
Make the kitty debug binary clear the screen before printing new stuff. And it should print a counter next to the key code debug.
And we should search in the haystack for the full string e.g. "key code(enter, modifiers=Ctrl) counter=3"
There was a problem hiding this comment.
Done in c5ac71d: the debug binary now clears the screen before printing each new key event, includes a per-event counter, and tests now assert full strings (e.g. key code(enter, modifiers=Ctrl) counter=3). No UI screenshot (CLI/test-only change).
Agent-Logs-Url: https://github.com/HalFrgrd/evp/sessions/2a470683-5a31-4eac-a0a6-571e4f5ea946 Co-authored-by: HalFrgrd <4559349+HalFrgrd@users.noreply.github.com>
HalFrgrd
left a comment
There was a problem hiding this comment.
Don't try and make a custom format, just use the debug representation of the KeyEvent. Print the keyEvent not just key code.
Update the tests to so they look for this format instead of our custom one
Agent-Logs-Url: https://github.com/HalFrgrd/evp/sessions/f5a8f7fc-b7f7-45ba-a17f-1c04f2bd9eb4 Co-authored-by: HalFrgrd <4559349+HalFrgrd@users.noreply.github.com>
Implemented in 105b8e3: |
HalFrgrd
left a comment
There was a problem hiding this comment.
Don't have a limit on the number of keys to expect.
Pressing q without any modifiers should exit the application. We should not print anything to screen when we press q.
Make the test script press q when it is finished.
Agent-Logs-Url: https://github.com/HalFrgrd/evp/sessions/202ed8ef-5208-4300-b6a3-b75fe57cb4ca Co-authored-by: HalFrgrd <4559349+HalFrgrd@users.noreply.github.com>
Implemented in 1726ada: removed the fixed key-event limit, plain unmodified |
Summary
tests/recording_json.rsintotests/common/mod.rsCommandkey alias support in script parsing (mapped to Super/Meta)src/bin/kitty_key_debug.rs, a crossterm-based helper that enables kitty keyboard enhancements, clears the screen between events, printscounter=<n> key={:?}using the fullKeyEventdebug representation, and exits on unmodifiedqwithout printing that key eventkitty_key_debugso it runs until explicit quit (q)tests/kitty_extended_keys.rsintegration coverage for kitty extended key protocol events includingPress Command,Release Command,Ctrl+Enter, and modifier combosKeyEventdebug output strings (instead of custom key-code formatting)q, and added an assertion thatqis not printedValidation
cargo test --all-targetscargo test --test kitty_extended_keyscargo test script::parser::tests::parses_key_aliases_modifier_only_and_actionsparallel_validation(Code Review passed; CodeQL timed out due tool time budget)