-
Notifications
You must be signed in to change notification settings - Fork 132
[Cmd] use prompt-toolkit native clipboard integration #1721
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
base: main
Are you sure you want to change the base?
Changes from 9 commits
3f84119
9238a70
0c9d215
cf631fa
c95b19d
158c215
dfe1bbd
c8c4a33
2bb5e68
861193a
c149c0b
b734d16
60f6f5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,3 +87,7 @@ class MacroError(Exception): | |
|
|
||
| class RedirectionError(Exception): | ||
| """Custom exception class for when redirecting or piping output fails.""" | ||
|
|
||
|
|
||
| class ClipboardError(Exception): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You should either catch class ClipboardError(RedirectionError):
"""Custom exception class for when clipboard operations fail.""" |
||
| """Custom exception class for when clipboard operations fail.""" | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyperclipClipboardis instantiated even ifallow_clipboardisFalse.The docstring states that setting
allow_clipboardtoFalsedisables clipboard interactions. However,PyperclipClipboardis currently added to thePromptSessionregardless of this flag (if the system clipboard is accessible). This natively enables system clipboard pasting inside the prompt, which contradicts the intention of disabling all clipboard interactions. If allow_clipboard is meant to disable all system clipboard access, you should conditionally checkself.allow_clipboard. (Note: If you apply this fix, you will also need to updatetest_init_with_no_clipboard_allowed).Recommend wrapping code ath initializes
cbinside a check: