This is the mail archive of the
mailing list for the Cygwin project.
Re: How do I define a key binding for copy-to-clipboard?
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Fri, 10 Sep 2004 00:52:29 -0700
- Subject: Re: How do I define a key binding for copy-to-clipboard?
- Organization: My own little world...
- References: <001501c49649$03a3ec30$ba968890@firsttec>
- Reply-to: cygwin at cygwin dot com
David Tombs wrote:
> I'm a Windows user trying to install and configure cygwin. Thus far I've
> managed to install bash and, mostly, configure it to my preferences.
> However, there is one thing missing. I want to use the clipboard to
> transfer text to and from Windows, with the same key bindings, viz
> Ctrl-C for copy and Ctrl-V for paste. (My left finger muscles are
> hardwired to these keys and anyway, I hate using the mouse for this kind
> of action.)
The short answer is that if you're using the default "Command Prompt"
then cmd.exe is handling the selection and copy operations and there's
no way to tell it to use ctrl-C as you want. The pasting is handled
entirely by bash so as you have found it's quite easy to make it do
what you want.
My advice would be to dump cmd.exe. Even ignoring the issue you're
having, it does not do copy and paste properly. It does selection as a
rectange rather than as linear text, which is how every other
text-oriented application works. rxvt is light years ahead of cmd.exe
in terms of functionality, once you get it running with some more
pleasing colors and font than the default (IMO). FYI I do this with a
shortcut to: (no doubt it might be easier to set these as resources
rather than on the command line; I know this.)
C:\cygwin\bin\rxvt.exe -g 130x60 -bg black -fg gray -fn "Lucida
Console-11" -sr -sl 5000 -j -cr white -sk -si -tn rxvt -e /bin/bash -li
And, it will automatically copy text when you select it, as in *nix,
which I find even easier than having to remember to press ctrl-C.
You *might* even be able to configure rxvt to recognise ^C as the
explicit copy-selection key, and disable the automatic copying. But,
you would also have to mess with your tty settings because ^C is usually
the 'interrupt' keystroke and can be very, very hard to live without in
a posix-like environment. You could this to some other keystroke,
though. Try "man stty". Also, I think Control-Break will also send the
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html