Skip to content

Line breaks are stripped when pasting multi-line text into Commit Summary #5181

@bbnolauv

Description

@bbnolauv

Describe the bug

When pasting multiple lines of text into the "Commit summary" editor, the newline characters are stripped, causing the content to be merged into a single line.

To Reproduce

  1. Copy a block of multi-line text.
  2. Open the Commit summary editor.
  3. Press Ctrl+Shift+V to paste the content.
  4. Result: The line breaks disappear, and the text becomes a single continuous string.

Original multi-line content for testing:

demo

- demo 1111111111111111111111111111
- demo 2222222222222222222222222222
- demo 3333333333333333333333333333
- demo 4444444444444444444444444444

Screenshots

Current behavior

Expected behavior

The editor should respect and preserve the original line breaks from the clipboard content like before.

Screenshots (v0.57.0)

Expected behavior

Version info:

~ lazygit --version
commit=v0.58.0, build date=2026-01-03T19:33:53Z, build source=binaryRelease, version=0.58.0, os=linux, arch=amd64, git version=2.52.0
➜  ~ git --version
git version 2.52.0

Additional Context

I’ve noticed that if I use Ctrl+O to open the Commit Menu and then press p, the multi-line content pastes correctly in both v0.57.0 and v0.58.0.

This suggests the internal pasting logic is still intact. However, it would be much more convenient if direct pasting via Ctrl+Shift+V in the summary field could also respect line breaks, as the current menu-based workaround is less efficient.


Thank you for your hard work on this project! I really enjoy using it and appreciate all your efforts. ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions