Skip to content

fix(tee): render absolute path in hint, no ~ shorthand - #2187

Closed
truffle-dev wants to merge 1 commit into
rtk-ai:developfrom
truffle-dev:fix/tee-hint-absolute-path-v2
Closed

truffle-dev wants to merge 1 commit into
rtk-ai:developfrom
truffle-dev:fix/tee-hint-absolute-path-v2

Conversation

@truffle-dev

@truffle-dev truffle-dev commented May 31, 2026 •

Copy link
Copy Markdown

Summary

The tee hint string is meant to be copy-pasted into a shell. With the ~ shorthand display_path currently emits, the path on macOS renders as:

[full output: ~/Library/Application Support/rtk/tee/7_curl.log]

That's not shell-safe:

  • cat "~/Library/Application Support/rtk/tee/..." does not expand ~ inside double quotes
  • cat ~/Library/Application Support/rtk/tee/... splits on the unquoted space

Fix

Drop the strip_prefix(home) branch in display_path. The path passed in is already absolute (built from data_local_dir()), so the helper collapses to a one-line path.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_hint before #1895 extracted display_path. Closing #1657 in favor of this. Closes #1644.

cargo test --quiet tee::tests is 22/22 green; cargo fmt --check and cargo clippy -- -D warnings are clean.

@rtk-release-bot rtk-release-bot Bot added the wrong-base PR targets master instead of develop label May 31, 2026
@rtk-release-bot

Copy link
Copy Markdown
Contributor

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.

@rtk-release-bot

Copy link
Copy Markdown
Contributor

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.

@truffle-dev
truffle-dev force-pushed the fix/tee-hint-absolute-path-v2 branch from 1fdcdaa to b0f90cd Compare June 1, 2026 00:21
@truffle-dev
truffle-dev changed the base branch from master to develop June 1, 2026 00:21
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
@truffle-dev
truffle-dev force-pushed the fix/tee-hint-absolute-path-v2 branch from b0f90cd to 78f9888 Compare June 5, 2026 04:02
@truffle-dev

Copy link
Copy Markdown
Author

Rebased onto develop at 78f9888 — the base is correct now. CI should re-run and the label can drop. Single-commit fix unchanged: src/core/tee.rs renders the absolute path in the hint so the copy-paste line works under shells that don't expand ~ inside double quotes.

@truffle-dev

Copy link
Copy Markdown
Author

Closing in favor of #2325 — that approach keeps the compact ~/... for simple paths and only renders quoted absolute paths when whitespace forces it. Better shape than stripping the shorthand outright. Thanks @fengjikui for picking up the more nuanced version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wrong-base PR targets master instead of develop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tee hint path with ~ shorthand breaks on paths with spaces (not shell-safe)

1 participant