C:\cygwin\bin\rxvt.exe -sr -sl 2500 -sb -e /bin/bash --login -i
Of course, once I had this working I wanted to customize the console with my favorite look & feel. I did this by creating a .Xdefaults file in my home directory and inserted the following:
rxvt*geometry: 100x60
rxvt*foreground: #ffffff
rxvt*background: #000000
!rxvt*font: -outline-Courier New-normal-r-normal-normal-18-96-120-120-c-100-iso8859-1
rxvt*font: Courier New-h9
rxvt*scrollBar: True
rxvt*scrollBar_right: True
I was pretty excited once I had this setup because I could now resize the window and I had a better font selection. I started a conversation with a colleague about rxvt and he said that one of the things he disliked was the paste via the middle mouse click and he would prefer the paste via a single right click. So I set out to make this change ....
Well, I learned a lot. First, I downloaded the source using the setup.exe that was provided by cygwin. Then I downloaded all the dependencies. Next, I compiled the source but I couldn't get it to work like the binary that was shipped with cygwin. I had to run the X server or it wouldn't render to the screen. Then, I started to dig deeper into why this wouldn't work and I found a little surprise, called cygport. What's interesting before we dive into cygport is that the readme in the source never mentions anything about cygport, I just happened to open the file that had a .cygport extension and became curious. Anyway long story short, you have to use cygport to download the source, apply the patches, compile and repackage the modifications.
Here are the steps that I used to compile:
Note: I had some trouble with xpm.h and I had to remove the following from rxvt-<version>-.cypoort
--with-xpm-includes=${B}/W11/X11
--with-xpm-library=${B}/W11/lib
cygport <rxvt.version> prep
cygport <rxvt.version> compile
Once I figured out how to compile cygwin, I added the code to allow pasting via right mouse click. In case your curious I added my modifications below:
--- origsrc/rxvt/src/rxvt.h 2004-01-29 16:54:19.000000000 -0700
+++ src/rxvt/src/rxvt.h 2007-11-29 10:23:49.312500000 -0700
@@ -588,6 +588,7 @@
Rs_cursorBlink,
Rs_pointerBlank,
Rs_pointerBlankDelay,
+ Rs_pasteWithRightClick,
NUM_RESOURCES
} ;
--- origsrc/rxvt/src/xdefaults.c 2004-01-29 17:19:20.000000000 -0700
+++ src/rxvt/src/xdefaults.c 2007-11-29 10:59:00.671875000 -0700
@@ -95,6 +95,7 @@
"reverse video"),
BOOL(Rs_loginShell, "loginShell", "ls", Opt_loginShell, "login shell"),
BOOL(Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, "jump scrolling"),
+ BOOL(Rs_pasteWithRightClick, "pasteWithRightClick", "pwrc", Opt_pasteWithRightClick, "Paste with right mouse click"),
#ifdef HAVE_SCROLLBARS
BOOL(Rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, "scrollbar"),
BOOL(Rs_scrollBar_right, "scrollBar_right", "sr", Opt_scrollBar_right,
--- origsrc/rxvt/src/rxvtlib.h.in 2003-08-24 23:32:50.000000000 -0600
+++ src/rxvt/src/rxvtlib.h.in 2007-11-30 15:10:51.093750000 -0700
@@ -220,6 +220,7 @@
#define Opt_mouseWheelScrollPage (1LU<<19) style="color: rgb(51, 51, 51);">
+++ src/rxvt/src/command.c 2007-11-29 11:30:36.890625000 -0700
@@ -1499,27 +1499,42 @@
rxvt_mouse_report(r, ev);
#endif /* MOUSE_REPORT_DOUBLECLICK */
} else {
- if (ev->button != h->MEvent.button)
+
+ if (ev->button != h->MEvent.button) {
h->MEvent.clicks = 0;
+ }
+
switch (ev->button) {
case Button1:
- if (h->MEvent.button == Button1 && clickintime)
- h->MEvent.clicks++;
- else
- h->MEvent.clicks = 1;
+
+ if (h->MEvent.button == Button1 && clickintime) {
+ h->MEvent.clicks++;
+ } else {
+ h->MEvent.clicks = 1;
+ }
+
rxvt_selection_click(r, h->MEvent.clicks, ev->x, ev->y);
h->MEvent.button = Button1;
break;
case Button3:
- if (h->MEvent.button == Button3 && clickintime)
- rxvt_selection_rotate(r, ev->x, ev->y);
- else
- rxvt_selection_extend(r, ev->x, ev->y, 1);
+
+ if (!(r->Options & Opt_pasteWithRightClick)) {
+ if (h->MEvent.button == Button3 && clickintime) {
+ rxvt_selection_rotate(r, ev->x, ev->y);
+ } else {
+ rxvt_selection_extend(r, ev->x, ev->y, 1);
+ }
+ } else {
+ rxvt_selection_request(r, ev->time, ev->x, ev->y);
+ }
+
h->MEvent.button = Button3;
break;
+
}
}
+
h->MEvent.time = ev->time;
return;
}
@@ -1702,22 +1717,35 @@
#endif /* MOUSE_REPORT_DOUBLECLICK */
return;
}
+
/*
* dumb hack to compensate for the failure of click-and-drag
* when overriding mouse reporting
*/
- if (r->h->PrivateModes & PrivMode_mouse_report
- && r->h->bypass_keystate
- && ev->button == Button1 && r->h->MEvent.clicks <= 1) - rxvt_selection_extend(r, ev->x, ev->y, 0);
+
+ if (r->h->PrivateModes & PrivMode_mouse_report &&
+ r->h->bypass_keystate && ev->button == Button1 && r->h->MEvent.clicks <= 1) { + rxvt_selection_extend(r, ev->x, ev->y, 0);
+ }
switch (ev->button) {
case Button1:
+ if ((r->Options & Opt_pasteWithRightClick)) {
+ rxvt_selection_make(r, ev->time);
+ break;
+ }
+
case Button3:
- rxvt_selection_make(r, ev->time);
+ if (!(r->Options & Opt_pasteWithRightClick)) {
+ rxvt_selection_make(r, ev->time);
+ }
break;
+
case Button2:
- rxvt_selection_request(r, ev->time, ev->x, ev->y);
+ if (!(r->Options & Opt_pasteWithRightClick)) {
+ rxvt_selection_request(r, ev->time, ev->x, ev->y);
+ }
+
break;
#ifdef MOUSE_WHEEL
case Button4: