`Command` debug-rendering of non-printable characters in environment variables is not shell-compatible
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
When there is a non-printable character in the value of an environment variable set via Command, the Debug output looks like this:
CARGO_ENCODED_RUSTFLAGS="-Zforce-unstable-if-unmarked\u{1f}-Aunexpected_cfgs" "cargo" "build"
The \u{1f} doesn't actually have the intended effect though -- pasting this command into a shell causes the environment variable to literally contain that string instead of containing the byte 0x1F.
Apparently the correct way to encode unicode values is $'\u1f', so the debug output should ideally be
CARGO_ENCODED_RUSTFLAGS="-Zforce-unstable-if-unmarked"$'\u1f'"-Aunexpected_cfgs" "cargo" "build"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Command debug output for environment variables, focusing on how non-printable characters are escaped. Verify the corrected rendering by pasting it into a shell and checking that the environment variable contains byte 0x1F rather than the literal escape text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100