feat: enhance :info meta command with pager, copy, and path masking#29
feat: enhance :info meta command with pager, copy, and path masking#29
:info meta command with pager, copy, and path masking#29Conversation
:info meta command with pager, copy, and path masking
6f5adef to
c6442b0
Compare
3e95a08 to
b6de2bb
Compare
There was a problem hiding this comment.
Pull request overview
Enhances the REPL :info meta command by switching it to a pager-based UI, adding clipboard copy support, and masking home-directory paths for privacy.
Changes:
- Move session info rendering from REPL printing to a pager (
crates/arf-console/src/pager/session_info.rs) with scroll UI andcto copy. - Introduce reusable OSC 52 clipboard helper in the pager module and reuse it in history schema.
- Add
mask_home_pathutility to replace home directory prefixes with~when displaying paths.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/arf-console/src/repl/session_info.rs | Removes the previous println-based :info implementation (migrated to pager). |
| crates/arf-console/src/repl/mod.rs | Stops compiling the old REPL session_info module; exposes state internally for pager use. |
| crates/arf-console/src/repl/meta_command.rs | Routes :info to the new pager-based display_session_info. |
| crates/arf-console/src/pager/session_info.rs | New pager-based session info UI, including copy-to-clipboard and path masking. |
| crates/arf-console/src/pager/mod.rs | Re-exports session info pager and centralizes OSC 52 clipboard implementation. |
| crates/arf-console/src/pager/history_schema.rs | Switches to shared copy_to_clipboard helper from pager module. |
| crates/arf-console/src/config/mod.rs | Adds mask_home_path helper + tests for home path masking. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Convert :info from println-based to pager-based display - Add 'c' key to copy session info to clipboard (OSC 52) - Mask home directory paths with ~ for privacy - Move session_info.rs to pager module for consistency - Share copy_to_clipboard between history_schema and session_info - Add ## Environment Variables section with Markdown-style heading - Add comprehensive tests for styling and masking functions Co-Authored-By: Claude Opus 4.5 <[email protected]>
b6de2bb to
4c82a08
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix platform-dependent test assertions that caused Windows CI to fail: - Use Path::display() for expected values instead of hard-coded paths - Use std::path::MAIN_SEPARATOR for path separators in tests - Use cfg!(windows) to determine path list separator (: vs ;) Co-Authored-By: Claude Opus 4.5 <[email protected]>
The interactive pager hangs on Windows CI due to lack of terminal. Use cfg_attr(windows, ignore) to skip these tests only on Windows. Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
crates/arf-console/src/repl/meta_command.rs:426
process_meta_command(":info", …)now launches an interactive pager loop. This test can hang on Unix/macOS when running withcargo test -- --nocapture(or any environment where stdout is a real TTY), because the pager waits for key events. Consider avoiding starting the pager under tests (e.g., dependency-inject a pager runner and use a no-op runner in tests), or mark this test#[ignore]/gate it on!io::stdout().is_terminal()so it can't block the suite.
#[test]
#[cfg_attr(windows, ignore)] // Windows CI lacks terminal for interactive pager
fn test_process_meta_command_info() {
let mut config = create_test_prompt_config();
let status = default_r_source_status();
let result = process_meta_command(":info", &mut config, &None, &None, &None, &status);
assert!(matches!(result, Some(MetaCommandResult::Handled)));
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #[test] | ||
| #[cfg_attr(windows, ignore)] // Windows CI lacks terminal for interactive pager | ||
| fn test_process_meta_command_info_with_config_path() { | ||
| let mut config = create_test_prompt_config(); | ||
| let status = default_r_source_status(); |
There was a problem hiding this comment.
This test triggers the interactive :info pager and can hang on Unix/macOS when run with --nocapture (or other TTY-attached setups). Consider refactoring to avoid starting the pager in unit tests (e.g., test generate_info_lines instead), or gate/ignore the interactive path so the suite can’t block.
- [Unreleased] history import (#31), :info enhancements (#29) - [0.2.0-beta.1] vi mode indicator (#23), Windows Rprofile fix (#20) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary
:infofromprintln-based to pager-based display with scrolling supportckey to copy session info to clipboard using OSC 52~for privacy (works with PowerShell on Windows)session_info.rsto pager module for consistency withhistory_schema.rscopy_to_clipboardfunction between history_schema and session_info## Environment Variablessection with Markdown-style heading:on Unix,;on Windows) when masking environment variablesIntentional changes
Test plan
cargo test -p arf-console session_info- 11 tests passcargo test -p arf-console- all tests pass:infoand verify pager displaycto copy and verify clipboard content~🤖 Generated with Claude Code