How to enable middle mouse button copy and paste with Cygwin?

2

0

I have a three button mouse. Within a shell (I use bash), on either OS X or linux, the selecting text and clicking the middle button copies the selection and pastes it at the cursor.

However, using Cygwin within a Command Prompt on Windows XP, I have to use the select text, enter, right button sequence to do the same thing. Is there a way to configure Cygwin to behave the same as OS X and Linux?

dacracot

Posted 2009-09-22T20:46:45.300

Reputation: 323

whats the cygwin process name, cygwin.exe? – John T – 2009-09-22T21:05:48.507

bash.exe or zsh.exe or tcsh.exe – akira – 2009-09-23T08:55:36.333

Answers

1

You should install and use rxvt instead of the Windows terminal (cmd.exe). rxvt can be installed by selecting it under Shells in the Cygwin installer and it automatically creates two shortcuts to Programs/Cygwin branch of the Start Menu (at least if you initially allowed shortcuts to be created), one for X and one without. So, you don't need to install X to use rxvt.

In rxvt you can use the middle button like you have used to straight away, without any further configurations. If you want to configure some aspect of rxvt you should refer to

/usr/share/doc/Cygwin/rxvt-<version>.README

which lists different possiple configuration options and some samples.

Jawa

Posted 2009-09-22T20:46:45.300

Reputation: 3 349

2

another option is to install mintty, which supports x11-selection-paste behavior as well

akira

Posted 2009-09-22T20:46:45.300

Reputation: 52 754

1

You may wish to consider puttycyg.

puttycyg is a patched version of PuTTY that allows you use PuTTY as a local Cygwin terminal.

(Sorry, SU prevents me from linking to more than one site. :-( I can't even enter the URL to the original PuTTY.)

Convict

Posted 2009-09-22T20:46:45.300

Reputation: 694

i went from rxvt -> puttycyg -> mintty, things got better from change to change – akira – 2009-09-23T12:10:35.080

@akira - Thanks for suggesting mintty. I've just installed it and it is working very well. It's much simpler to configure than puttycyg. I also like having an rc configuration file rather than the configuration being hidden away in the registry. mintty will now be my default recommendation to people wanting a good Cygwin terminal. [I would have added this comment to your answer, but I don't have enough reputation. :-(] – Convict – 2009-09-24T02:52:49.280

0

Check that your mouse is really sending the middle click by reviewing its settings. This can certainly be an issue on a TouchPad device, perhaps also a proper mouse. As an alternative, try other key combinations, such as Shift+Insert.

Steve Pitchers

Posted 2009-09-22T20:46:45.300

Reputation: 271

0

An AutoHotkey approach:

MButton::

Process, Exist, bash.exe

if ErrorLevel
{
    WinWaitActive, ahk_pid %ErrorLevel%
    Send { Enter }
    ClipWait
    Send %clipboard%
    return
}
else
{
    Send { MButton }
    return
}

depending on what shell you're using you may need to change the executable name. I'm not sure on the process name cygwin uses.

John T

Posted 2009-09-22T20:46:45.300

Reputation: 149 037