jesseduffield / jesseduffield/lazygit

Prevent accidental paste

Open
#1,873 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

I was trying to paste a Jira ticket into my commit message but accidentally pasted a large code snippet instead. Luckily it doesn't seem to have resulted in any accidental changes to the repo, but it was certainly possible for a series of resulting keypresses to have resulted in some unwanted behavior.

I'm not sure if it's the terminal which handles paste events and translates them to a series of keypresses or if lazygit handles paste events directly. If Lazygit doesn't see the actual paste event and just the individual keystrokes, maybe there could be a check added for key events to see if they are happening too quickly to be the result of a user actually pressing keys.

This was certainly a user error and the result of some carelessness on my end, but I think this would be a handy guard to have in place

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.