--- button.c- 2024-04-19 01:42:00.000000000 -0600 +++ button.c 2024-06-25 14:36:24.551748557 -0600 @@ -2909,15 +2909,15 @@ static SelectUnit EvalSelectUnit(XtermWidget xw, - Time buttonDownTime, - SelectUnit defaultUnit, - unsigned int button) + XButtonEvent *event, + SelectUnit defaultUnit) { + Time buttonDownTime = event->time; TScreen *screen = TScreenOf(xw); SelectUnit result; int delta; - if (button != screen->lastButton) { + if (event->button != screen->lastButton) { delta = screen->multiClickTime + 1; } else if (screen->lastButtonUpTime == (Time) 0) { /* first time and once in a blue moon */ @@ -2930,7 +2930,11 @@ delta = (int) ((((Time) ~ 0) - screen->lastButtonUpTime) + buttonDownTime); } - if (delta > screen->multiClickTime) { + if ((event->state & ShiftMask)) { + screen->numberOfClicks = 1; + screen->andPasteToo = !(event->state & ControlMask); + result = Select_WORD; + } else if (delta > screen->multiClickTime) { screen->numberOfClicks = 1; result = defaultUnit; } else { @@ -2951,9 +2955,8 @@ if (SendMousePosition(xw, event)) return; screen->selectUnit = EvalSelectUnit(xw, - event->xbutton.time, - Select_CHAR, - event->xbutton.button); + &event->xbutton, + Select_CHAR); screen->replyToEmacs = False; #if OPT_READLINE @@ -3013,9 +3016,8 @@ CELL cell; screen->selectUnit = EvalSelectUnit(xw, - event->time, - Select_CHAR, - event->button); + event, + Select_CHAR); if (screen->numberOfClicks > 1) { PointToCELL(screen, event->y, event->x, &cell); screen->replyToEmacs = True; @@ -3179,6 +3181,10 @@ } } SelectSet(xw, event, params, num_params); + if (screen->andPasteToo) { + xtermGetSelection((Widget) xw, event->xbutton.time, params, num_params, NULL); + screen->andPasteToo = False; + } screen->eventMode = NORMAL; } @@ -3245,9 +3251,8 @@ || !(SCREEN_FLAG(screen, dclick3_deletes))) #endif screen->selectUnit = EvalSelectUnit(xw, - event->xbutton.time, - screen->selectUnit, - event->xbutton.button); + &event->xbutton, + screen->selectUnit); screen->replyToEmacs = False; #if OPT_READLINE --- ptyx.h- 2024-05-21 17:30:59.000000000 -0600 +++ ptyx.h 2024-06-25 14:36:24.555081890 -0600 @@ -2965,6 +2965,7 @@ Time selection_time; /* latest event timestamp */ Time lastButtonUpTime; unsigned lastButton; + Boolean andPasteToo; #define MAX_CUT_BUFFER 8 /* CUT_BUFFER0 to CUT_BUFFER7 */ #define MAX_SELECTIONS (MAX_SELECTION_CODES + MAX_CUT_BUFFER)