whatscli icon indicating copy to clipboard operation
whatscli copied to clipboard

Ctrl+C or Ctrl+V doesn't work and results in error

Open Masacaai opened this issue 5 years ago • 7 comments

When pressing the above two key combinations, whatscli exits and gives this error message:

panic: runtime error: slice bounds out of range [1:0] [recovered]
	panic: runtime error: slice bounds out of range [1:0]

goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1(0xc0001961c0)
	github.com/rivo/[email protected]/application.go:243 +0x87
panic(0x5563b1e1fba0, 0xc0009a1580)
	runtime/panic.go:969 +0x1b9
github.com/zyedidia/clipboard.getCopyCommand(...)
	github.com/zyedidia/[email protected]/clipboard_unix.go:154
github.com/zyedidia/clipboard.writeAll(0xc0000a9f00, 0x1b, 0x5563b1a2eca2, 0x9, 0x5563b15d2ee8, 0xc000250410)
	github.com/zyedidia/[email protected]/clipboard_unix.go:177 +0x330
github.com/zyedidia/clipboard.WriteAll(...)
	github.com/zyedidia/[email protected]/clipboard.go:21
main.handleCopyUser(0xc00026aae0, 0xc00022b320)
	command-line-arguments/main.go:209 +0x165
gitlab.com/tslocum/cbind.(*Configuration).Capture(0xc00025c090, 0xc00026aae0, 0x0)
	gitlab.com/tslocum/[email protected]/configuration.go:111 +0x178
github.com/rivo/tview.(*Application).Run(0xc0001961c0, 0x0, 0x0)
	github.com/rivo/[email protected]/application.go:314 +0x765
main.main()
	command-line-arguments/main.go:129 +0x1465

I'm running the AUR version

Masacaai avatar Dec 20 '20 22:12 Masacaai

I guess the zyedidia/clipboard library doesn't find an appropriate place to put the data. Is xclip working on that machine?

normen avatar Dec 20 '20 22:12 normen

Do you mean xclipboard?

Masacaai avatar Dec 21 '20 06:12 Masacaai

I mean the xclip command. https://github.com/astrand/xclip

normen avatar Dec 21 '20 09:12 normen

I'm sorry, I probably should have done more research before blindly asking about xclipboard. I've tried a few xclip commands and they all seem to be working.

Masacaai avatar Dec 26 '20 14:12 Masacaai

Sorry to re-ask this question. I can use xclip on my Ubuntu, meaning that I can copy something (github web address for example) and in my console when I make:

$ xclip -o 

Works well. The question is: How do I paste the same link into WhatsCli??

best regards Paulo Aboim Pinto

aboimpinto avatar Mar 15 '22 02:03 aboimpinto

Works well. The question is: How do I paste the same link into WhatsCli??

Depends on your terminal. The same way you'd paste something into the command line in general.

normen avatar Mar 15 '22 10:03 normen

if you insist on using keybinds, it might work for you (depending on your terminal) ctrl shift c and ctrl shift v