Skip to content

fix(dotenv-quote): normalize vertical tab and form feed control characters - #5128

Closed
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/dotenv-quote-control-chars
Closed

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/dotenv-quote-control-chars

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

ods/lib/dotenv-quote.sh serializes values for single-line .env files shared by Bash, Docker Compose, and ODS's safe environment parser. It normalizes carriage returns (\r) and newlines (\n) to spaces to maintain single-line assignments.

However, non-printable vertical whitespace characters—specifically form feeds (\f / ASCII 12) and vertical tabs (\v / ASCII 11)—were previously preserved unescaped. When present in model descriptions, raw JSON tokens, or configuration payloads, these characters break strict POSIX dotenv parsers and cause formatting issues across tools.

Normalizing \f and \v to spaces alongside \r and \n guarantees portable, single-line variable serialization across all shells and container runtimes.

Overlap check

Searched live open/closed PRs by dotenv-quote, dotenv, and lib/dotenv-quote.sh. #3820 merged double-quote serialization for single quotes, and #3712 normalized CRLF endings. None covers non-printable vertical whitespace (\f and \v). This change directly extends the existing whitespace normalization filter in dotenv_quote.

Validation

  • Added test cases for $'form\ffeed' and $'vertical\vtab' to ods/tests/test-dotenv-serializer.sh.
  • Ran bash ods/tests/test-dotenv-serializer.sh: All 30 test scenarios pass round-trip verification across both Bash source and safe-env parsing.
  • ShellCheck passes on ods/lib/dotenv-quote.sh.

Review status and composition

Independent human review welcome. Change is 2 lines in ods/lib/dotenv-quote.sh and 4 lines in ods/tests/test-dotenv-serializer.sh. Composes cleanly on upstream public-beta HEAD 33155fb5.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

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