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

Added copy (yank) function #62

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anorm
Copy link

@anorm anorm commented Oct 25, 2024

Using the pyperclip library, I've added copying of the currently selected line in pointer mode to the system clipboard.

@anorm anorm mentioned this pull request Oct 25, 2024
@willmcgugan
Copy link
Contributor

@anorm
Copy link
Author

anorm commented Oct 25, 2024

Oops, didn't see that one. Not used Textual before 😃

However, this note in the documentation makes this a non-option for me:

This does not work on macOS Terminal, but will work on most other terminals.

@willmcgugan
Copy link
Contributor

The macOS terminal hasn't been updated in many years. You get a far better experience from iTerm2 or other third party terminal.

Pyperclip won't work over shh, AFAIK, so I couldn't accept that I'm afraid.

@anorm
Copy link
Author

anorm commented Oct 25, 2024

Ah, right. I am using iTerm2 but I read the note as "any terminal on MacOS". My bad.

I will update the PR

@anorm anorm force-pushed the feature/yank-line branch from 1d7b0cb to 18e6242 Compare October 25, 2024 17:20
@anorm
Copy link
Author

anorm commented Oct 25, 2024

I've updated the PR branch now.

Ideally, the copy function should be complemented by a multi-line select as I wrote in the comment on #23

I would like to extend the request to copying multiple lines at once. I currently have a stack trace of ~30 lines with several lines wider than my terminal can display. So, for me, copying individual lines is tedious.

Hence, I propose to allow a range of lines to be selected in pointer mode, and a key to copy to the system clipboard. (Similar to the following in vim: Vjjj then "+y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants