0

I had Cygwin and its X-Windows installed on my Windows 10 laptop. On all of my Windows computers (Acer, EliteBook, some Dell brand, and others), the Windows 10 and X-Windows clipboard buffers were common (or somehow made to behave as if they were common). Here is a description of the two buffers.

I recently had to duplicate this Cygwin setup. My workhorse EliteBook (840 G6) started to show keyboard circuit problems, so I was lucky enough to get a replacement EliteBook 650 G9. They differ in physical form factor, but software-wise, they are more similar than any other two laptops that I've ever used. It was simple to replicate the Cygwin environment using this package list migration procedure, although the package versions themselves would be the most recent available (presumably!).

Since the computers are very similar, as are the Cygwin packages, I would expect very similar behaviour. However, when I use Cygwin to put text into the copy/paste buffer, it cannot be pasted in a Cygwin xterm using Shift+Ins. Instead, I need to issue a middle-mouse-button click (which I emulate in Windows 10 with a 3-finger tap).

While this does not work on the new EliteBook 650 G9, it did work on my various past laptops, including the EliteBook 640 G6. Even on the new EliteBook 650 G9, it Shift-Ins does work on a Cygwin mintty (the default terminal that is launched for Bash). How can I get Shift+Ins to paste into xterm?

Troubleshooting

Shift+Ins doesn't paste into an xterm in the new EliteBook 650 G9 regardless of how I put text into the Primary or Clipboard buffers, including the following:

  • Highlight in a Windows 10 window and press Ctrl+C
  • Highlight in a Cygwin mintty terminal
  • Highlight in a Cygwin mintty terminal and press <Return> (which copies from a CMD terminal window)
  • Using Gvim to yank into register * (Primary selection buffer)
  • Using Gvim to yank into register + (Clipboard buffer)
  • In a CMD terminal window, highlight text and press
  • In an xterm, select some text

In all of the above, the emulated middle-mouse-button click does paste into the xterm with the exception of Gvim yanking into register +; the latter doesn't seem to update the Primary selection buffer. All of the above also seems to paste into the Cygwin mintty terminal using Shift+Ins, and into Windows notepad using Shift+Ins and Ctrl+V.

I confirmed proper functionality of the Shift+Ins not just in Cygwin's mintty terminal, but also in Windows's Notepad. It pastes text placed into Cygwins Primary selection and Clipboard buffers.

This Cygwin X-Windows page shows that the two buffers are supposed to be integrated by default. I confirmed that the checkbox for Clipboard may use PRIMARY selection is enabled. My ~/.Xresources files is identical on both EliteBooks, and I have nothing in there pertaining to clipboards (just fonts and colour).

1 Answer 1

0

According to this posted answer to the absence of an Insert key on HP EliteBooks, Fn+E generates an Ins keystroke. It only works for those EliteBooks that are designed to generate an Ins keystroke in response to that combination of key presses. It works on both my dying 840 G6 and my 650 G9.

It is, however, a bit more complicated than described because it's not obvious how to effect the depression of the Fn key. Apparently, you don't just hold down the key marked Fn. Rather, you hold down the CapsLock key first, then hold down the Fn key. Only then do you press the E key to paste: CapsLock+Fn+E.

xterm responds to this as if the middle mouse button is pressed, pasting whatever text is in the Primary Selection. Since the Primary Selection is supposed to be synchronized to the Clipboard Buffer by Cygwin, we can just think of simply as "pasting" (or at least, we can now, with the discovery of how to effect a Shift+Ins paste).

What this tells me is that the following input events are intercepted / received at different levels, sometimes at the application level, and conditionally mapped to each other:

  • Ctrl+V
  • Middle mouse button click
  • CapsLock+Fn+E
  • Shift+Ins[ert]

The dependency on the application is clear from these facts: (i) Ctrl+V only pastes for Windows apps; (ii) Middle-mouse button click only pastes for Cygwin apps (mintty and xterm); (iii) CapsLock+Fn+E pastes for Windows, Cygwin, and Cygwin X-Windows apps; and (iv) Shift+Ins[ert] pastes for Cygwin's mintty terminal and Windows apps, but not xterm (and possibly not for X-Windows in general). The last caveat about not working for xterm seems furthermore to be installation dependent, as this is the first laptop for which Shift+Ins[ert] does not work.

For laptops that have an actual Shift+Ins[ert] key, such as my new EliteBook 650 G9, CapsLock+Fn+E is a different key combination. It can therefore be very confusing to say that the latter "is" Shift+Ins[ert]. For clarity, I suggest that any discussion of CapsLock+Fn+E refer to that key combination as a synthetic Shift+Ins[ert] in order to distinguish it from the actual depression of the physical Shift+Ins[ert] keys that are present on the keyboard.

If Shift+Fn+E isn't a solution for you, another potential solution is this use of "SharpKeys" to remap an otherwise unused key to the desired Shift+Ins.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .