Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freezes when pasting a string that includes a line breaks #4216

Closed
ShortArrow opened this issue Jan 27, 2025 · 4 comments · Fixed by #4234
Closed

Freezes when pasting a string that includes a line breaks #4216

ShortArrow opened this issue Jan 27, 2025 · 4 comments · Fixed by #4234
Labels
bug Something isn't working

Comments

@ShortArrow
Copy link

Describe the bug

In Commit message mode,
Pasting text with multiple line breaks causes the lazygit to freeze.
There seems to be no solution other than quitting the terminal emulator.

To Reproduce

Steps to reproduce the behavior:

  1. Open lazygit
  2. Input 'c' to go commit mode
  3. Paste with ctrl + shift + v
  4. Pasting only gets to the middle of the first line and then stops
  5. Shell freezes

OK sample

fix(heirline): unify background color scheme

NG sample

fix(heirline): unify background color scheme

Updated background color assignments in the heirline configuration to use
`scheme.bg` instead of local scheme values. This change ensures a consistent
background color across different UI elements.

Expected behavior

If there are two line breaks at the end of the first line,
it has the same effect as tab and the remaining text is pasted into the commit description.

Tried

I tried it in the following environment, but the symptoms are the same:

  • Powershell7 in WezTerm
  • Powershell7 in Windows Terminal
  • Powershell7 in Alacritty
  • cmd.exe in Windows Terminal

Version info:

lazygit

commit=c03b89227092b852d50015d289a7c6d8c69811c5, build date=2025-01-17T13:37:10Z, build source=binaryRelease, version=0.45.2, os=windows, arch=amd64, git version=2.42.0.windows.1

git

git version 2.42.0.windows.1

Additional context

config https://github.com/ShortArrow/dotfiles/blob/develop/lazygit/config.yaml

logs

Jan 27 09:16:45 |INFO| git rev-parse --symbolic-full-name main@{u} (161.9271ms)
Jan 27 09:16:45 |DEBU| RunCommand command="git -C C:/Users/shoutarou_t/Documents/GitHub/dotfiles rev-parse --path-format=absolute --absolute-git-dir"
Jan 27 09:16:46 |INFO| postRefreshUpdate for tags took 0s
Jan 27 09:16:46 |INFO| git rev-parse --abbrev-ref --verify
HEAD (78.9773ms)
Jan 27 09:16:46 |INFO| git for-each-ref --sort=refname --format=%(refname:short) refs/remotes (79.8178ms)
Jan 27 09:16:46 |INFO| postRefreshUpdate for remotes took 0s
Jan 27 09:16:46 |INFO| postRefreshUpdate for remoteBranches took 0s
Jan 27 09:16:46 |INFO| git -c log.showSignature=false log -g --abbrev=40 --format=%h%x00%ct%x00%gs%x00%p (89.8188ms)
Jan 27 09:16:46 |INFO| postRefreshUpdate for reflogCommits
took 0s
Jan 27 09:16:46 |DEBU| RunCommand command="git merge-base HEAD refs/remotes/origin/main"
Jan 27 09:16:46 |DEBU| RunCommand command="git merge-base develop develop@{u}"
Jan 27 09:16:46 |DEBU| RunCommand command="git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(push:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads"
Jan 27 09:16:46 |INFO| git merge-base develop develop@{u} (101.7162ms)
Jan 27 09:16:46 |INFO| git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(push:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads (100.1921ms)
Jan 27 09:16:46 |INFO| postRefreshUpdate for localBranches
took 21.8µs
Jan 27 09:16:46 |INFO| git merge-base HEAD refs/remotes/origin/main (135.4556ms)
Jan 27 09:16:46 |INFO| git log HEAD --topo-order --oneline
--pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%m%x00%s --abbrev=40 -300 --no-show-signature -- (148.0885ms)
Jan 27 09:16:46 |DEBU| using cache for key rebase.updateRefs
Jan 27 09:16:46 |INFO| postRefreshUpdate for commits took 10.003ms
Jan 27 09:16:46 |DEBU| using cache for key rebase.updateRefs
Jan 27 09:16:55 |INFO| Heap memory in use: 3.6 MB
Jan 27 09:16:55 |INFO| refreshing the following scopes in sync mode: files
Jan 27 09:16:55 |INFO| refreshed merge conflicts in 0s
Jan 27 09:16:55 |DEBU| using cache for key status.showUntrackedFiles
Jan 27 09:16:55 |DEBU| RunCommand command="git status --untracked-files=all --porcelain -z --find-renames=50%"
Jan 27 09:16:55 |INFO| git status --untracked-files=all --porcelain -z --find-renames=50% (75.4137ms)
Jan 27 09:16:55 |INFO| refreshed files in 83.1826ms
Jan 27 09:16:55 |INFO| Refresh took 83.281ms
Jan 27 09:17:05 |INFO| Heap memory in use: 3.7 MB
Jan 27 09:17:05 |INFO| refreshing the following scopes in sync mode: files
Jan 27 09:17:05 |INFO| refreshed merge conflicts in 0s
Jan 27 09:17:05 |DEBU| using cache for key status.showUntrackedFiles
Jan 27 09:17:05 |DEBU| RunCommand command="git status --untracked-files=all --porcelain -z --find-renames=50%"
Jan 27 09:17:05 |INFO| git status --untracked-files=all --porcelain -z --find-renames=50% (69.4437ms)
Jan 27 09:17:05 |INFO| refreshed files in 80.6637ms
Jan 27 09:17:05 |INFO| Refresh took 80.6637ms
Jan 27 09:17:15 |INFO| refreshing the following scopes in sync mode: files
Jan 27 09:17:15 |INFO| Heap memory in use: 3.9 MB
Jan 27 09:17:15 |INFO| refreshed merge conflicts in 514.1µs

Jan 27 09:17:15 |DEBU| using cache for key status.showUntrackedFiles
Jan 27 09:17:15 |DEBU| RunCommand command="git status --untracked-files=all --porcelain -z --find-renames=50%"
Jan 27 09:17:15 |INFO| git status --untracked-files=all --porcelain -z --find-renames=50% (74.0176ms)
@ShortArrow ShortArrow added the bug Something isn't working label Jan 27, 2025
@stefanhaller
Copy link
Collaborator

I suppose this is a duplicate of #3151 (and #4066). Whether it freezes or otherwise behaves badly depends on what's in the clipboard.

Here's a PR that should fix this: #4234. Please test if you can build from source.

@ShortArrow
Copy link
Author

ddd.mp4

Maybe, 943d78f is no effects for this issue for me.

@stefanhaller
Copy link
Collaborator

@ShortArrow The reason why #4234 doesn't work for you is that you're on Windows, and handling the bracketed paste events from the terminal is not supported yet by the tcell library on Windows. I'll look into whether this can be added, and make a PR in tcell if so. But I see this as independent from #4234, and I don't want this to hold up merging that one as it's already an improvement for Mac and Linux users.

@ShortArrow
Copy link
Author

@stefanhaller Based on your information, it looks like this is unrelated to #4234. It's probably the tcell bug you mentioned. In that case, I think it's better to leave this issue and merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants