Skip to content

feat: enhance :info meta command with pager, copy, and path masking#29

Merged
eitsupi merged 3 commits intomainfrom
feat/info-pager
Feb 1, 2026
Merged

feat: enhance :info meta command with pager, copy, and path masking#29
eitsupi merged 3 commits intomainfrom
feat/info-pager

Conversation

@eitsupi
Copy link
Copy Markdown
Owner

@eitsupi eitsupi commented Feb 1, 2026

Summary

  • Convert :info from println-based to pager-based display with scrolling support
  • Add c key to copy session info to clipboard using OSC 52
  • Mask home directory paths with ~ for privacy (works with PowerShell on Windows)
  • Move session_info.rs to pager module for consistency with history_schema.rs
  • Share copy_to_clipboard function between history_schema and session_info
  • Add ## Environment Variables section with Markdown-style heading
  • Environment variable paths are now clickable in supporting terminals
  • Properly handle path lists (: on Unix, ; on Windows) when masking environment variables

Intentional changes

  • Removed working directory display: The working directory often contains project names that users may not want to share when copying session info for bug reports.

Test plan

  • cargo test -p arf-console session_info - 11 tests pass
  • cargo test -p arf-console - all tests pass
  • Manual test: run :info and verify pager display
  • Manual test: press c to copy and verify clipboard content
  • Manual test: verify paths are masked with ~

🤖 Generated with Claude Code

@eitsupi eitsupi changed the title feat: enhance :info command with pager, copy, and path masking feat: enhance :info meta command with pager, copy, and path masking Feb 1, 2026
@eitsupi eitsupi marked this pull request as ready for review February 1, 2026 10:55
Copilot AI review requested due to automatic review settings February 1, 2026 10:55
@eitsupi eitsupi force-pushed the feat/info-pager branch 2 times, most recently from 3e95a08 to b6de2bb Compare February 1, 2026 10:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 and c to copy.
  • Introduce reusable OSC 52 clipboard helper in the pager module and reuse it in history schema.
  • Add mask_home_path utility 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]>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

eitsupi and others added 2 commits February 1, 2026 11:13
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]>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with cargo 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.

Comment on lines 433 to 437
#[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();
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@eitsupi eitsupi merged commit 9cfaed6 into main Feb 1, 2026
16 checks passed
@eitsupi eitsupi deleted the feat/info-pager branch February 1, 2026 11:30
eitsupi added a commit that referenced this pull request Feb 1, 2026
- [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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants