unable to copy/paste in mingw shell

前端 未结 7 993
不知归路
不知归路 2021-01-30 12:01

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 Mi

相关标签:
7条回答
  • 2021-01-30 12:37

    [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
    0 讨论(0)
  • 2021-01-30 12:40

    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
    
    0 讨论(0)
  • 2021-01-30 12:40

    OK, what you need to do is: Right Click, Paste!

    0 讨论(0)
  • 2021-01-30 12:44

    I ran into this problem and above solutions didn't work for Windows 10. This is because there is no Properties on the Menu. However with the above solution content, I was able to resolve it for Windows 10 as follows: Right click the icon on the top left hand corner of MINGW64: Select Options Now Select keys On the right hand you will find Shortcuts If not thicked, thick Copy and Paste Now always remeber the instruction given to copy & paste as follows: Copy: Ctrl+ Ins (insert) i.e. To copy on MINGW, only highlight whatever you want to copy, then press Ctrl Insert keys Paste; Shift+ Ins (insert) i.e. To paste, place your cursor where you want paste. Then press Shift Insert keys

    Now select Mouse On the right hand you will find Mouse functions If not thicked, thick Copy on select and Copy as rich text For mouse button, thick Right mouse paste Note: to copy on MINGW, simply highlight whatever you want to copy. Then place your cursor where you want paste. then click the mouse right button. Now click save or Apply then Save. I have tried these and everything is fine. Note that you can also copy from any other source and use paste to MINGW using the paste instructions above.

    0 讨论(0)
  • 2021-01-30 12:46

    Win7 running MINGW64 (mintty 2.7.3) which came with the current version of Git Bash 2.1.3.0 from date of this comment.

    Right click title bar of shell > Mouse > under Click actions > Right mouse button > select the Paste radio button.

    However, I was surprised to find this didn't allow me to paste using my right click on my mouse.

    I had to also select Application mouse mode > Default click target > Window

    After changing both settings I was able to paste.

    So it seems the new shell that comes with the current version of Git bash has new features. It also seems to be a bit buggy. For instance running an an executable via cli (e.g. php -version results in empty output and forces me to restart the shell). Waiting for a new update, hopefully which will fix this.

    0 讨论(0)
  • 2021-01-30 12:52

    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.

    0 讨论(0)
提交回复
热议问题