Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <41415D3D.19663606@dessent.net> Date: Fri, 10 Sep 2004 00:52:29 -0700 From: Brian Dessent Organization: My own little world... MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: How do I define a key binding for copy-to-clipboard? References: <001501c49649$03a3ec30$ba968890 AT firsttec> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 'interrupt' key. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/