santinic / how2

AI for the Command Line
https://how2terminal.com
MIT License
5.72k stars 156 forks source link

Unable to Copy the Code #55

Closed ahmadawais closed 8 years ago

ahmadawais commented 8 years ago

I am unable to copy the code from terminal when I am searching for another question with the SPACE and found an answer. Not able to select the code and copy it. Any help in there?

danyshaanan commented 8 years ago

Can you provide the exact steps you take to reproduce it? Including the line you run, the SPACE navigation, and the output you try to copy.

ahmadawais commented 8 years ago

See when I search for it, the first answer that I get, I can select and copy stuff from inside

But when I press SPACE for more answers and get to an answer, there I cannot select the text or copy anything.

danielkop commented 8 years ago

@ahmadawais I think you pasted the same image twice.

Is this using ZSH? on which os?

ahmadawais commented 8 years ago

@danielkop Can you recheck the images, just refresh?

ahmadawais commented 8 years ago

Yes, I am using ZSH on Mac.

h-ayat commented 8 years ago

Same problem here. ZSH on Arch linux

smmoosavi commented 8 years ago

Good repo, Good issue Same issue. I use bash in terminator in ubuntu

danyshaanan commented 8 years ago

This is an issue with blessed, or with the way it is configured to run here. If you'd try to run the example code in the link above, you'll see that the text is not selectable.

ahmadawais commented 8 years ago

^Any solution for that?

santinic commented 8 years ago

@ahmadawais @smmoosavi @h-ayat it was {mouse:true}. Either you can mouse scroll, or you can copy-paste.

It's fixed in 1.0.9. Now you can't mouse scroll, but you can copy-paste.

Make sure you update with "npm install -g how2"

h-ayat commented 8 years ago

Thanx for quick reply and fix. I've updated how2 to the latest version. Now mouse clicks and scroll does nothing, And there's a bug in selecting multi-line text, because background boxes get selected too.

I've attached a snapshot from the bug:

how2

danyshaanan commented 8 years ago

@h-ayat I wouldn't call it a bug, as this is the intended behaviour of selection in the terminal, which is why I believe that it could not be resolved for the current view.

A possible alternative is to modify the way blessed is used here, and display the content of that window in full width without borders.

ahmadawais commented 8 years ago

^Same problem here. Thanks for the update but one cannot copy more than one line.

danielkop commented 8 years ago

A lot of terminals have a column select (or block select) feature. With Ubuntu try holding Ctrl+Alt before you select, or Alt+Cmd if you're in iTerm.

h-ayat commented 8 years ago

@danyshaanan Thank you anyway. @danielkop Very nice trick :+1: Actually solved many problems other than this !

danielkop commented 8 years ago

@h-ayat It also works in a lot of text editors and IDEs. Block selection changed my life :grinning:

santinic commented 8 years ago

@danielkop such a nice trick! thanks, I'm putting it in the readme

ahmadawais commented 8 years ago

@danielkop Thanks for the tip, I never knew that.