Repository navigation
fix(tee): render absolute path in hint, no ~ shorthand - #2187
truffle-dev wants to merge 1 commit into
Conversation
|
Automatic message from CI checks : It seems like this branch is targeting the wrong branch, any contribution should target develop branch. See CONTRIBUTING.md for details. |
|
Automatic message from CI checks : It seems like this branch is targeting the wrong branch, any contribution should target develop branch. See CONTRIBUTING.md for details. |
1fdcdaa to
b0f90cd
Compare
The hint line is meant to be copy-pasted into a shell. With the ~ shorthand: - cat "~/Library/Application Support/rtk/tee/..." does not expand ~ inside double quotes - cat ~/Library/Application Support/rtk/tee/... splits on the space The path passed to display_path is already absolute (built from data_local_dir()), so dropping the strip_prefix branch is a small edit. Adds two regression tests covering the home-prefixed and space-containing shapes. Closes rtk-ai#1644
b0f90cd to
78f9888
Compare
|
Rebased onto |
|
Closing in favor of #2325 — that approach keeps the compact |
Summary
The tee hint string is meant to be copy-pasted into a shell. With the
~shorthanddisplay_pathcurrently emits, the path on macOS renders as:That's not shell-safe:
cat "~/Library/Application Support/rtk/tee/..."does not expand~inside double quotescat ~/Library/Application Support/rtk/tee/...splits on the unquoted spaceFix
Drop the
strip_prefix(home)branch indisplay_path. The path passed in is already absolute (built fromdata_local_dir()), so the helper collapses to a one-linepath.display().to_string(). Two regression tests cover the home-prefixed and space-containing shapes.Notes
Supersedes #1657, which I opened against the pre-refactor
format_hintbefore #1895 extracteddisplay_path. Closing #1657 in favor of this. Closes #1644.cargo test --quiet tee::testsis 22/22 green;cargo fmt --checkandcargo clippy -- -D warningsare clean.