Skip to content

feat(tui): add option to copy space-joined argv#291

Open
kxxt wants to merge 1 commit into
mainfrom
sja
Open

feat(tui): add option to copy space-joined argv#291
kxxt wants to merge 1 commit into
mainfrom
sja

Conversation

@kxxt

@kxxt kxxt commented Jul 15, 2026

Copy link
Copy Markdown
Owner

This PR adds traditional execsnoop-style output as an option to the copy dialog.

Summary by CodeRabbit

  • New Features

    • Added a copy option that joins a command’s arguments into a single space-separated line.
    • Added a configurable keyboard shortcut for this copy option, using w by default.
    • The new option is available in the copy selection menu.
  • Bug Fixes

    • Displays a clear message when command arguments cannot be read.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tracexec Ready Ready Preview, Comment Jul 15, 2026 3:29pm

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: db70731a-a3f7-4a6a-9a62-cd1e59982ee6

📥 Commits

Reviewing files that changed from the base of the PR and between 1b0cefc and 5c31942.

📒 Files selected for processing (5)
  • config.toml
  • crates/tracexec-core/src/cli/keys.rs
  • crates/tracexec-core/src/copy.rs
  • crates/tracexec-tui/src/copy_popup.rs
  • crates/tracexec-tui/src/event.rs

Walkthrough

Adds a configurable ArgvJoined TUI copy target that joins event argv values with spaces, displays it in the copy popup, and supports default and overridden key bindings.

Changes

Joined argv copy target

Layer / File(s) Summary
Joined argv formatting
crates/tracexec-core/src/copy.rs, crates/tracexec-tui/src/event.rs
Adds CopyTarget::ArgvJoined, joins argv values with spaces, and returns a failure string when argv cannot be read; tests cover both results.
Key binding configuration
crates/tracexec-core/src/cli/keys.rs, config.toml
Adds optional and resolved key-binding fields, defaults the target to w, supports configuration overrides, and tests TOML parsing.
TUI copy selection wiring
crates/tracexec-tui/src/copy_popup.rs
Adds the joined argv target to the selectable copy targets and maps it to its configured key list.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CopyPopup
  participant TuiKeyBindings
  participant text_for_copy
  participant Event
  User->>CopyPopup: press configured ArgvJoined key
  CopyPopup->>TuiKeyBindings: resolve copy_target_argv_joined
  CopyPopup->>text_for_copy: request ArgvJoined text
  text_for_copy->>Event: read argv
  Event-->>text_for_copy: argv values or read error
  text_for_copy-->>CopyPopup: joined argv or failure text
  CopyPopup-->>User: show copied target
Loading

Possibly related PRs

  • kxxt/tracexec#268: Extends related text_for_copy and argv-focused test coverage.
  • kxxt/tracexec#287: Introduces the shared copy-target and text_for_copy machinery extended here.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a TUI option to copy space-joined argv.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sja

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new copy target option, ArgvJoined (bound to 'w' by default), which allows copying command-line arguments joined by whitespace. The changes span configuration files, keybindings, copy popup UI, and core copy logic, accompanied by corresponding unit tests. As there are no review comments, no further feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.19%. Comparing base (074c56b) to head (5c31942).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/tracexec-tui/src/copy_popup.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
+ Coverage   82.16%   82.19%   +0.03%     
==========================================
  Files          84       84              
  Lines       20904    20926      +22     
==========================================
+ Hits        17175    17200      +25     
+ Misses       3729     3726       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant