Skip to content

Pasting multiple lines into commit summary field executes commands #3151

@OliverJAsh

Description

@OliverJAsh

Describe the bug
When pasting multiple lines into commit summary field, any characters on lines after the first line will be executed as commands.

To Reproduce
Steps to reproduce the behavior:

  1. Stage a change.
  2. Open the commit form (c).
  3. Paste this into the commit summary field:
    B
    o
    

Expected behavior
Only the first line is used. Subsequent lines are discarded.

OR

Subsequent lines are pasted into the commit description field.

Screenshots

Screen.Recording.2023-12-08.at.10.41.31.mov

Version info:
lazygit --version: 0.40.2
git --version: 2.42.0

Additional context
This happens to me frequently when I paste the contents of the "copy commit message" shortcut. In this example it's just opening a file (o), but in some cases it can cause much more harm.

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