Title: Support multi-line commit body input by axkoro · Pull Request #1919 · commitizen-tools/commitizen · GitHub
Open Graph Title: Support multi-line commit body input by axkoro · Pull Request #1919 · commitizen-tools/commitizen
X Title: Support multi-line commit body input by axkoro · Pull Request #1919 · commitizen-tools/commitizen
Description: Description The interactive commit prompt had no way to enter multi-line commit bodies without resorting to --edit or using the newline separator | which is completely undocumented, from what I can tell. This PR enables multi-line input for the commit body by setting multiline=True on the body question. This uses Questionary's native multi-line input. I also added a custom key binding, so that Enter submits on an empty buffer (skipping the field). Otherwise it now inserts a newline. Non-empty input can be submitted with Alt+Enter (Questionary's default). Checklist I have read the contributing guidelines Was generative AI tooling used to co-author this PR? Yes (please specify the tool below) Generated-by: Claude following the guidelines Code Changes Add test cases to all the changes you introduce Run uv run poe all locally to ensure this change passes linter check and tests Manually test the changes: Verify the feature/bug fix works as expected in real-world scenarios Test edge cases and error conditions Ensure backward compatibility is maintained Document any manual testing steps performed Update the documentation for the changes No updating required, from what I can tell. Steps to Test This Pull Request Added: entering multi-line commit body Run cz commit and proceed to the body prompt Type something, press Enter → a newline should be inserted Type another line, press Alt+Enter → the input should be submitted with both lines preserved in the commit body Kept: skipping the commit body Run cz commit and proceed to the body prompt (Enter nothing) Press Enter → the field should be skipped Additional Context The body prompt now displays a > prefix, which is prompt_toolkit's default multi-line indicator. This is slightly inconsistent with the other input fields. Remove it or keep this and maybe even add it to the other inputs as well? Resolves #1917
Open Graph Description: Description The interactive commit prompt had no way to enter multi-line commit bodies without resorting to --edit or using the newline separator | which is completely undocumented, from what I can...
X Description: Description The interactive commit prompt had no way to enter multi-line commit bodies without resorting to --edit or using the newline separator | which is completely undocumented, from what I can...
Opengraph URL: https://github.com/commitizen-tools/commitizen/pull/1919
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3a80f259-2d2a-6920-7da2-35a8b0b57229 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 831A:2E7285:2E8B5A1:3FAFAE5:6A4EF81F |
| html-safe-nonce | 8e397dfb63e8b22f5f95096fa492ce6ce6822324a1d6e149eb9bc8ff5acdc657 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzFBOjJFNzI4NToyRThCNUExOjNGQUZBRTU6NkE0RUY4MUYiLCJ2aXNpdG9yX2lkIjoiNzg0Mjg2ODQ3MTk0MzU5MTk2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 35e021203e42cf0eed71a8d90f72b479545b2e4b3bfe26fd9838a6f635f91761 |
| hovercard-subject-tag | pull_request:3473266915 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/commitizen-tools/commitizen/pull/1919/files |
| twitter:image | https://avatars.githubusercontent.com/u/24815452?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/24815452?s=400&v=4 |
| og:image:alt | Description The interactive commit prompt had no way to enter multi-line commit bodies without resorting to --edit or using the newline separator | which is completely undocumented, from what I can... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git |
| octolytics-dimension-user_id | 62252524 |
| octolytics-dimension-user_login | commitizen-tools |
| octolytics-dimension-repository_id | 106127589 |
| octolytics-dimension-repository_nwo | commitizen-tools/commitizen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 106127589 |
| octolytics-dimension-repository_network_root_nwo | commitizen-tools/commitizen |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width