Skip to content

Commit

Permalink
Add clipboard configuration option. Resolve #43.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryneeverett committed Dec 3, 2015
1 parent 0f9f701 commit 3bf8958
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/ptpython_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
from __future__ import unicode_literals
from prompt_toolkit.keys import Keys
from prompt_toolkit.clipboard.pyperclip import PyperclipClipboard
from pygments.token import Token
from ptpython.layout import CompletionVisualisation

Expand Down Expand Up @@ -138,6 +139,9 @@ def _(event):
b.insert_text(' ')
"""

# Use system clipboard.
repl.clipboard = PyperclipClipboard()


# Custom colorscheme for the UI. See `ptpython/layout.py` and
# `ptpython/style.py` for all possible tokens.
Expand Down
1 change: 1 addition & 0 deletions ptpython/python_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ def create_application(self):
buffers=buffers,
key_bindings_registry=self.key_bindings_registry,
paste_mode=Condition(lambda cli: self.paste_mode),
clipboard=getattr(self, 'clipboard', None),
mouse_support=Condition(lambda cli: self.enable_mouse_support),
on_abort=AbortAction.RETRY,
on_exit=self._on_exit,
Expand Down

0 comments on commit 3bf8958

Please sign in to comment.