Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to copy/paste in mingw shell

I just installed MinGW on Windows and I'm unable to copy/paste as I am used to on Linux or even PuTTY. What is the trick for copying and pasting text (e.g. from chrome) into MinGW shell?

like image 607
user788171 Avatar asked May 03 '13 16:05

user788171


People also ask

How do I copy and paste in Mingw?

To copy: highlight the portion you want and click 'y' To cut: highlight the portion you want and click 'd' To paste: Ctrl + Shift + v.

How do you copy and paste in Shell?

Ctrl+Shift+C and Ctrl+Shift+V If you highlight text in the terminal window with your mouse and hit Ctrl+Shift+C you'll copy that text into a clipboard buffer. You can use Ctrl+Shift+V to paste the copied text into the same terminal window, or into another terminal window.

How do I enable copy and paste in terminal?

Similarly, you can use Ctrl+shift+C to copy text from the terminal and then use it to paste in a text editor or web browser using the regular Ctrl+V shortcut. Basically, when you are interacting with the Linux terminal, you use the Ctrl+Shift+C/V for copy-pasting.

How do I enable copy and paste in Ubuntu terminal windows?

This can be enabled through the same settings menu described below by clicking the checkbox next to "Use Ctrl+Shift+C/V as Copy/Paste". Another solution would be to enable "QuickEdit Mode" and then you can paste by right-clicking in the terminal.


3 Answers

Right-click on the title bar of the command window and select 'Properties', then on the 'Options' tab tick the box for the 'QuickEdit mode', then click 'Ok'.

After that you can paste text from the clipboard using the right mouse-button, highlight text while holding down the left mouse-button and copy selected text using the ENTER key.

This procedure works on Windows 7/8, not Windows 10.

like image 117
Andreas Avatar answered Oct 10 '22 01:10

Andreas


[Alternative] For MINGW64 (mintty 2.7.9) terminal in Windows 10, you can enable "Ctrl+Shift+letter shortcuts" to perform copy with (Ctrl+Shift+c) and paste with (Ctrl+Shift+v).

To enable the feature:

  1. right-click command window
  2. Click on 'Keys'
  3. Check the box for 'Ctrl+Shift+letter shortcuts'

When you vi/vim into a file:

  • To copy: highlight the portion you want and click 'y'
  • To cut: highlight the portion you want and click 'd'
  • To paste: Ctrl+Shift+v
like image 34
Bokkers Ling Avatar answered Oct 10 '22 03:10

Bokkers Ling


This mintty bug CTRL + C & CTRL + V copy paste addresses the issue. It allows normal Control-C, Control-V copy and pasting, but at the expense of changing other control characters. So to stop a process running you need Control-Shift-C, to interrupt it you would need Control-Shift-Z and to send an EOT you need Control-Shift-D. You may find the advantage of windows copy and paste outwights the disadvantages.

The behavior needs a flag to be set in the .minttyrc file. WHich should look like

CtrlShiftShortcuts=yes
CtrlExchangeShift=yes
like image 8
Salix alba Avatar answered Oct 10 '22 03:10

Salix alba