copy and paste with a program called clipboard

eryk sun eryksun at gmail.com
Thu Jul 19 21:29:28 EDT 2018


On Thu, Jul 19, 2018 at 5:42 PM, Terry Reedy <tjreedy at udel.edu> wrote:
>
> What happens when you right click depends on the program you are interacting
> with.  When you select and right-click in the current Windows 10 console,
> used for Command Prompt, PowerShell, Python, and other programs, the
> selection disappears.  I just discovered that it also copies to the
> clipboard.  I also just discovered that right click without a selection
> pastes the current clipboard contents.  (I usually use ^X, ^C, and ^V.)
> Since the console is in the process of being improved, I have no idea how
> long this has been true.

Prior to Windows 10, the console uses either "quick-edit" or "mark"
mode for text selection.

If "QuickEdit Mode" is selected in the console properties, mouse
events are consumed internally by the console to support text
selection. When text is selected, the enter key or right-click copies
it. Other keys, including Ctrl+C, cancel the selection. If no text is
selected, then right-click pastes the contents of the clipboard. You
can also select "Copy" and "Paste" from the edit menu. Quick-edit mode
can cause problems since it's easy to accidentally select text, which
causes most console functions (e.g. reading from the input buffer) to
block until the selection is copied or cancelled. Quick-edit mode also
incompatible with text-interface applications that require mouse
input.

If quick-edit mode is disabled, by default right-click should display
the edit menu, which has a "Mark" command. In mark mode you can use
the cursor keys (arrows, home, end, page up/down) to position the
cursor, and hold shift plus the cursor keys to select text. You can
also use the mouse to select and copy text in mark mode.

Windows 10

In the new console, selecting "enable Ctrl key shortcuts" enables
special support for control characters. In this mode, the old control
characters can still be entered by including the shift key (e.g.
Ctrl+Shift+V to get ^V). Without shift, we have, for example, Ctrl+F
to find text, Ctrl+M to enter mark mode, Ctrl+A to select all text,
and Ctrl+V to paste from the clipboard. Regardless of this setting, if
text is selected, Ctrl+C copies it to the clipboard. Otherwise, with
the default settings and no text selected, Ctrl+C sends a CTRL_C_EVENT
to all processes attached to the console.

If "extended text selection keys" is selected, text can be selected
starting at the current cursor position using the cursor keys while
holding shift. Mouse selection is also supported after you start
selecting text with the keyboard. It's like mark mode, except only
from the current cursor position.

If "enable line wrapping selection" is enabled, text is selected by
line and wraps as if the screen buffer were a continuous line. Hold
Alt to get the classic rectangle selection. The Alt key actually acts
like a toggle here. If "enable line wrapping selection" is not
selected, then the default is rectangle mode and holding Alt switches
to line mode.


More information about the Python-list mailing list