copy-pasting in Git Bash

4,363 views
Skip to first unread message

namin

unread,
Jan 15, 2009, 2:47:17 AM1/15/09
to msysGit
Is there a way to copy-paste from and to the Git Bash Console? If not,
any plans to add this feature?

Thanks for the good work.

Marek Baczynski

unread,
Jan 15, 2009, 7:23:33 AM1/15/09
to msysGit
Right-click on the window title bar, there are edit options there.
When selecting, enter copies.

Robin Rosenberg

unread,
Jan 15, 2009, 4:18:29 PM1/15/09
to imba...@gmail.com, msysGit
torsdag 15 januari 2009 22:17:20 skrev Robin Rosenberg:
> Better yet, change the windows properties to enable quick edit. Then
> you can paste with just right-click.
>
> -- robin
>

Johannes Schindelin

unread,
Jan 15, 2009, 9:04:28 PM1/15/09
to Robin Rosenberg, imba...@gmail.com, msysGit, torgil....@gmail.com
Hi,

On Thu, 15 Jan 2009, Robin Rosenberg wrote:

> > Better yet, change the windows properties to enable quick edit. Then
> > you can paste with just right-click.

BTW this is something that bothered me forever with the stupid, stupid
Windows console.

However,
http://code.google.com/p/msysgit/issues/detail?id=29&colspec=ID%20Type%20Status%20Priority%20Component%20Owner%20Summary
(Issue 29: Change to another more user-friendly terminal) seems to be
dead in the water. I once had high hopes, but it seems that Windows
people are less enthusiastic than necessary to get stuff done.

Ciao,
Dscho

namin

unread,
Jan 18, 2009, 4:39:38 PM1/18/09
to msysGit
Thanks, that's good to know. So, it's not an easy task to add copy-
paste support in terms of Cltr-C/Cltr-V ?

Johannes Schindelin

unread,
Jan 18, 2009, 4:58:14 PM1/18/09
to namin, msysGit
Hi,

On Sun, 18 Jan 2009, namin wrote:

>
> Thanks, that's good to know. So, it's not an easy task to add copy-
> paste support in terms of Cltr-C/Cltr-V ?

Two things:

- please do not top-post,

- direct this issue to Microsoft Support, as it has nothing to do with Git
Bash, but all with cmd.exe.

Ciao,
Dscho

Alexander Gavrilov

unread,
Jan 18, 2009, 5:49:21 PM1/18/09
to msy...@googlegroups.com, Johannes....@gmx.de, namin

Actually, the Windows console window has nothing to do with cmd.exe
as well, it is managed by a core system service called csrss.exe:

http://blogs.msdn.com/oldnewthing/archive/2007/12/31/6909007.aspx

It also somewhat explains the difficulty of replacing the console
with a different application: unlike ptys in Linux there is no
generic interface for it, the console functionality is hardwired
into the system. Cygwin probably has some kind of pty emulation
in its runtime, but that won't work for native applications.

Alexander

Johannes Schindelin

unread,
Jan 18, 2009, 8:26:44 PM1/18/09
to Alexander Gavrilov, msy...@googlegroups.com, namin
Hi,

On Mon, 19 Jan 2009, Alexander Gavrilov wrote:

> Actually, the Windows console window has nothing to do with cmd.exe

That must be the reason why we call "cmd.exe /c bash --login -i" to get
the console window.

Ciao,
Dscho

Steve Wagner

unread,
Jan 19, 2009, 1:02:34 AM1/19/09
to msysGit, torgil....@gmail.com
No i think this is not a bug of windows console. I can simply do a right
click to paste my actually clipboard to a normal console window (with
quick edit mode enabled). It only dose not works when using bash (cygwin
and msys).

Johannes Schindelin schrieb:

Marius Storm-Olsen

unread,
Jan 19, 2009, 2:07:33 AM1/19/09
to Johannes....@gmx.de, Alexander Gavrilov, msy...@googlegroups.com, namin
Johannes Schindelin said the following on 19.01.2009 02:26:

Nope. A console application on Windows will create its own console
window, should it not inherit one from its parent.

You'll see that if you hit WindowsKey+R, and try to start bash from
there. The console window appears with no cmd.exe parent process.

I'm not sure why the "cmd.exe /c" was prepended, but it must be for
some other reason.

--
.marius

Alexander Gavrilov

unread,
Jan 19, 2009, 4:38:09 AM1/19/09
to li...@lanwin.de, msysGit, torgil....@gmail.com
On Mon, Jan 19, 2009 at 9:02 AM, Steve Wagner <li...@lanwin.de> wrote:
> No i think this is not a bug of windows console. I can simply do a right
> click to paste my actually clipboard to a normal console window (with
> quick edit mode enabled). It only dose not works when using bash (cygwin
> and msys).

Did you try checking the properties for the relevant windows? On my
system the GIT Bash shortcut had Quick Edit disabled. After I enabled
it, it worked without any problems.

Alexander

Alexander Gavrilov

unread,
Jan 19, 2009, 4:56:45 AM1/19/09
to Marius Storm-Olsen, Johannes....@gmx.de, msy...@googlegroups.com, namin

The CreateProcess API call allows specifying flags to suppress the
console window of the child process. Using cmd as an intermediate step
allows overriding it in some cases.

For example, if you simply add {sh.exe --login -i} as a command to the
new Tools menu of git-gui, it won't work, because bash would try to
use its stdin/stdout for I/O, which are in this case connected to
git-gui via pipes. As a result, it would print the first prompt, and
immediately quit because of EOF on stdin.

On the other hand, {cmd //c "start sh.exe --login -i"} (note the //,
it is necessary) would create a new console window and run bash there.

However, the only role cmd plays here is passing appropriate flags to
the system when starting sh.exe.

Alexander

Johannes Schindelin

unread,
Jan 19, 2009, 7:46:18 AM1/19/09
to Steve Wagner, msysGit, torgil....@gmail.com
Hi,

On Mon, 19 Jan 2009, Steve Wagner wrote:

> No i think this is not a bug of windows console. I can simply do a right
> click to paste my actually clipboard to a normal console window (with
> quick edit mode enabled). It only dose not works when using bash (cygwin
> and msys).

Steve, please do not top-post. It is outright annoying.

And further, the thing with the Windows console is that you _have_ to
enable the quick edit. It is not enabled by default.

Ciao,
Dscho

leandr...@gmail.com

unread,
Oct 17, 2013, 1:48:15 PM10/17/13
to msy...@googlegroups.com
Only paste...

To paste a text in the git bash, use INSERT button 

=/

Erik Faye-Lund

unread,
Oct 17, 2013, 1:51:41 PM10/17/13
to leandr...@gmail.com, msysGit
There's support for both, just like in the normal windows console:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/windows_dos_copy.mspx?mfr=true
> --
> --
> *** Please reply-to-all at all times ***
> *** (do not pretend to know who is subscribed and who is not) ***
> *** Please avoid top-posting. ***
> The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github
> accounts are free.
>
> You received this message because you are subscribed to the Google
> Groups "msysGit" group.
> To post to this group, send email to msy...@googlegroups.com
> To unsubscribe from this group, send email to
> msysgit+u...@googlegroups.com
> For more options, and view previous threads, visit this group at
> http://groups.google.com/group/msysgit?hl=en_US?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "msysGit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to msysgit+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

leandr...@gmail.com

unread,
Oct 17, 2013, 2:00:23 PM10/17/13
to msy...@googlegroups.com, leandr...@gmail.com, kusm...@gmail.com
Hummm.... ok

Obrigado (thanx)!

Att,

Leandro
Reply all
Reply to author
Forward
0 new messages