You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sure there's a history behind it and a good rationale for initially adding it, but is there any possibility of getting rid of it? I'd prefer to not have to choose between clipboard access and "returning".
How would you distinguish between a user pasting text and a user typing text? As far as i know from the application's point of view there is no difference.
It's like Vi also has a :set paste option.
In paste mode, automatic indentation is off. This will paste verbatim and not insert additional spaces.
That could be possible, but system clipboard synchronisation is hard to do correctly without using libraries like gtk or qt. I prefer to not depend on this for now.
@jonathanslenders Have you seen pyperclip? It's cross platform, lean (~200 loc), and appears to depend on any one of xclip, xsel, gtk, or qt on Linux. Would you be open to adding pyperclip as a dependency?
Activity
jonathanslenders commentedon May 22, 2015
Hi @ryneeverett
How would you distinguish between a user pasting text and a user typing text? As far as i know from the application's point of view there is no difference.
It's like Vi also has a
:set pasteoption.In paste mode, automatic indentation is off. This will paste verbatim and not insert additional spaces.
Jonathan
ryneeverett commentedon May 22, 2015
@jonathanslenders Got it. I understand why it is currently needed. But couldn't we bind
y,p, etc. to clipboard operations?jonathanslenders commentedon May 31, 2015
That could be possible, but system clipboard synchronisation is hard to do correctly without using libraries like gtk or qt. I prefer to not depend on this for now.
ryneeverett commentedon Jun 14, 2015
@jonathanslenders Have you seen pyperclip? It's cross platform, lean (~200 loc), and appears to depend on any one of xclip, xsel, gtk, or qt on Linux. Would you be open to adding pyperclip as a dependency?
jonathanslenders commentedon Jun 16, 2015
Yes, I have seen that. I'm not going to add another dependency, but I'll try to create an example of how to create an extension using this clipboard.
You can pass in any clipboard object in prompt-toolkit: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/prompt_toolkit/application.py#L49 I'll try to update ptpython, so that you can pass that through.
shanechin commentedon Jul 26, 2015
Is it possible to add this in via some configuration? or would it require a fork as of today?
jonathanslenders commentedon Jul 30, 2015
This is work in progress. I'm going to make this easier.
A PyperclipClipboard is already in prompt-toolkit: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/examples/system-clipboard-integration.py
ryneeverett commentedon Aug 2, 2015
Sweet! The example implementation looks pretty good.
It doesn't appear that there is any way to override the clipboard without forking ptpython so I'm assuming such a mechanism is forthcoming.
Add clipboard configuration option. Resolve prompt-toolkit#43.
ryneeverett commentedon Dec 3, 2015
A tip for my fellow
viusers:repl.enable_open_in_editor = False.Add clipboard configuration option. Resolve prompt-toolkit#43.
mixmastamyk commentedon Oct 31, 2017
Wouldn't bracketed paste be useful here?