Skip to content

fix: preserve multiline hook scripts as TOML triple-quoted strings#23

Merged
tupe12334 merged 1 commit into
mainfrom
issue-21
Feb 23, 2026
Merged

fix: preserve multiline hook scripts as TOML triple-quoted strings#23
tupe12334 merged 1 commit into
mainfrom
issue-21

Conversation

@tupe12334

Copy link
Copy Markdown
Member

Summary

  • toml_quoted in src/config/ser.rs now detects values containing \n and emits a TOML multiline basic string ("""...""") instead of escaping newlines as \\n
  • Hook scripts remain human-readable and editable after config.save() is called
  • Single-line values are unchanged

Test plan

  • test_multiline_hook_uses_triple_quotes — verifies multiline output uses """ and contains no \n escapes
  • test_multiline_hook_round_trips — verifies the TOML parses back to the original script string
  • All 84 existing tests continue to pass

Closes #21

🤖 Generated with Claude Code

`toml_quoted` now detects values containing newlines and emits a TOML
multiline basic string (`"""..."""`) instead of escaping `\n` as `\\n`.
This keeps hook scripts human-readable and editable in the config file.

Closes #21

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tupe12334
tupe12334 merged commit 6ff39bf into main Feb 23, 2026
@tupe12334
tupe12334 deleted the issue-21 branch February 23, 2026 12:26
tupe12334 added a commit that referenced this pull request Feb 23, 2026
Verify that a post:open script with real newlines (as parsed from a
TOML triple-quoted string) executes every command — not just the first
line.  Before the TOML serialiser fix (#23) the script was truncated
to its shebang on load, so subsequent commands were silently ignored.

Closes #26

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tupe12334 added a commit that referenced this pull request Feb 23, 2026
Verify that a post:open script with real newlines (as parsed from a
TOML triple-quoted string) executes every command — not just the first
line.  Before the TOML serialiser fix (#23) the script was truncated
to its shebang on load, so subsequent commands were silently ignored.

Closes #26

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
tupe12334 pushed a commit that referenced this pull request Feb 23, 2026
Closes #23

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tupe12334 pushed a commit that referenced this pull request Feb 23, 2026
Mark centy issue #23 as closed following the merge of PR #31 which
added the logo header image to README.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tupe12334 added a commit that referenced this pull request Feb 23, 2026
chore(centy): close issue #23 - README logo header image
tupe12334 pushed a commit that referenced this pull request Feb 24, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tupe12334 added a commit that referenced this pull request Feb 24, 2026
Verify that a post:open script with real newlines (as parsed from a
TOML triple-quoted string) executes every command — not just the first
line.  Before the TOML serialiser fix (#23) the script was truncated
to its shebang on load, so subsequent commands were silently ignored.

Closes #26

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tupe12334 pushed a commit that referenced this pull request Feb 24, 2026
Closes #23

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tupe12334 pushed a commit that referenced this pull request Feb 24, 2026
Mark centy issue #23 as closed following the merge of PR #31 which
added the logo header image to README.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tupe12334 added a commit that referenced this pull request Feb 24, 2026
chore(centy): close issue #21 - multiline hook scripts fixed in PR #23
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.

setup: hook scripts serialized as single escaped line, losing multiline formatting

1 participant