lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Copying commit hash crashes Lazygit

Open MuratUrsavas opened this issue 5 years ago • 9 comments

I've tried to copy the hash from the reflog window via "CTRL + o" but got this message:

2020/12/14 14:21:13 An error occurred! Please create an issue at https://github.com/jesseduffield/lazygit/issues

*errors.errorString No clipboard utilities available. Please install xsel, xclip, wl-clipboard or Termux:API add-on for termux-clipboard-get/set.
github.com/jesseduffield/lazygit/main.go:133 (0xa09eb3)
runtime/proc.go:203 (0x43149e)
runtime/asm_amd64.s:1357 (0x45cec1)

Got fixed after installing xsel. I guess xsel or xclip should be a dependency.

Environment:

  • OS: Ubuntu 20.04
  • Lazygit Version : build date=2020-10-14, build source=debian, version=0.23.6, os=linux, arch=amd64

MuratUrsavas avatar Dec 14 '20 11:12 MuratUrsavas

I think that error message is appropriate, but we should have it appear in an error panel rather than have it crash the app. This should be simple enough to implement so I'll put a hacktoberfest label on it.

jesseduffield avatar Sep 25 '21 03:09 jesseduffield

I think adding 'xsel' to the dependencies could be a good idea. It would get rid of this error in the first place.

MuratUrsavas avatar Sep 25 '21 07:09 MuratUrsavas

when you say dependencies are you referring specifically to the ubuntu installation method? I am not super across how that's set up :/

jesseduffield avatar Sep 27 '21 10:09 jesseduffield

Yes, exactly. It's done in the deb configuration. Not a big deal. I've learned it recently but need some refresh as some time passed since. Will check it out and return back.

MuratUrsavas avatar Sep 27 '21 10:09 MuratUrsavas

Got back: You just need to add xsel into the control file of debian package into the "Build-Depends:" section. This way apt would know it should install xsel before lazygit.

MuratUrsavas avatar Sep 27 '21 10:09 MuratUrsavas

Now we simply need to work out how to access that control file haha

jesseduffield avatar Sep 27 '21 10:09 jesseduffield

:)

Who's running the launchpad PPA?

MuratUrsavas avatar Sep 27 '21 10:09 MuratUrsavas

I believe it was @dawidd6 at some point. I should really just get a registry of people in charge of each installation method

jesseduffield avatar Sep 27 '21 23:09 jesseduffield

Also if you get status -1 when trying to copy commit hash via ssh. use -X flag when connecting to your server.

ssh -X my_ssh_server

Tej12345 avatar Jun 20 '22 10:06 Tej12345