5

I'm using git-for-windows MING64 MinTTY running on Windows 7. When I select text on git bash, it always trigger ctrl+C(which will display ^C in the next command line.

e.g.: When I left click down to select “git --version”, then left click up, the next command line becomes “$^C”.

$ git --version

git version 2.9.2.windows.1

$^C

Has anyone ever encounted this issue? And how to fix it? I download the exe file from https://github.com/git-for-windows/git/releases.

screenshot

Clashsoft
  • 11,553
  • 5
  • 40
  • 79
sunny_lunars
  • 83
  • 1
  • 1
  • 7

7 Answers7

6

Enter the keyboard combination Alt+Space Bar to open the system menu of the command window. Then use the select and copy options from there.

There's step-by-step expanded instruction here.

See also Copying and Pasting in Git Bash. Excerpt as follows:

Copying and Pasting in Git Bash

The default way to copy/paste in Git Bash is by using the menu (accessed by going to the top left) to "mark" to select what you want to copy and then use the menu again to paste.

This gets inefficient pretty quickly, so it's a good idea to set up QuickEdit mode to make copying and pasting much faster. To do this, go to Menu->Properties and in the Options tab select QuickEdit Mode.

enter image description here

Community
  • 1
  • 1
CryptoPiggy
  • 700
  • 2
  • 8
  • 21
  • I'm not running the git bash from cmd, just run the git-bash.exe. The paste is effective, my main question is when I use mouse to select test on git bash window, it always prompted ^C in git bash command line, that's painful, is there anyway can suppress this? – sunny_lunars Jul 28 '16 at 05:47
  • Your question was "How do you copy from gitbash(Git Bash)" – CryptoPiggy Jul 28 '16 at 05:50
  • Ok. you're right. I upload the pic again, I only allow to upload one pic now. My git-bash dropdown menu is like the one I just uploaded(can click the "enter image description here" to see). The pic you showed is the one for git-cmd in my environment. May be the interface changed in new version. – sunny_lunars Jul 28 '16 at 06:00
  • If run in command, it calls git-cmd.exe not git-bash.exe. git-cmd.exe in command run can work normal. Thanks for you advice. – sunny_lunars Jul 28 '16 at 06:13
  • I knew you'd get there eventually. ;-) Glad I could help. Please select my answer. :-) – CryptoPiggy Jul 28 '16 at 06:16
  • sincerely, I'm not found how to select your answer, I just registered and really new to this, or could you show me? – sunny_lunars Jul 28 '16 at 06:23
  • Sure. There's a 'Tick' symbol and an up arrow to the top-left of my `Answer`. Pls click them both. :-) – CryptoPiggy Jul 28 '16 at 06:25
5
  • on windows 10
  • Git-bash( git version 2.14.1.windows.1)

copy: CTRL + INSERT
paste: SHIFT + INSERT

Source here

christianbueno.1
  • 516
  • 1
  • 8
  • 12
3
  • Copy: Ctrl + (Left Click Highlight)
  • Paste: Right Click
MJ Montes
  • 3,234
  • 1
  • 19
  • 21
2

I use the mouse:

  1. mark
  2. right click -> copy
  3. right click -> paste
Hind
  • 333
  • 3
  • 7
1

You can use autohotkeys to convert Shift + Insert to another shotcut you want. I use this way in my autohotkeys file:

^+v::^Ins

To me is better Ctrl+Shift+V instead of Ctrl+V to avoid compatibility issues with vim, but if you don't use vim you can use the common way.

Another solution is use console emulators like conemu it allows you edit all shotcuts.

1

In my Git Bash, I've done Left click down > Selected text > Left click up. The selected text remains selected. ^C doesn't appear on the console.

^C appears on the console only if I click Ctrl+C.

Your settings are different from the default settings. Use the default settings.
mintty version: 3.4.4 (x86_64-pc-mysys) [Windows 19042]

Arun Kumar B
  • 196
  • 9
-1

some other software which intercept your signal: check your processes and try to close/kill as much as possible to see if the issue persists. in my case its YodaoDict.exe

fuyun
  • 1
  • 3