I have started to diagnose using xclip. This gave me a reminder that there are two clipboards on Ubunutu : XA_PRIMARY and XA_CLIPBORAD
- Crtr-C in Geany copies to XA_CLIPBOARD (as expected) and not to XA_PRIMARY - Shift-Insert in terminal pastes the content of XA_PRIMARY, which is the cause of my problem
Fortunately, I discovered that Right-click -> popup menu -> Paste pastes XA_CLIPBOARD and not XA_PRIMARY, which I did not know
So the solution to my problem is: **to copy-paste from Geany to terminal, use the right click instead of shift-insert.**
Curiously this is not necessary for most other programs because (I just tested gedit and firefox): - selecting (silently and secretly) copies to XA_PRIMARY as soon as the selection is done (no need to de-select), a behaviour I did not know about btw - Crtl-C copies to XA_CLIPBOARD as expected (then XA_PRIMARY incidentally is equal to XA_CLIPBOARD until you select something else in one of those programs)
Btw I was used to do Ctrl-C in firefox then Shift-Insert in the terminal: the Ctrl-C step was in fact not necessary.
I do not know if this is voluntary or not that Geany does not behave like most other programs.
(My personnal opinion is that neither Geany nor Firefox are faltly: the user friendly way to go would be if Ubuntu developers could find a way to disable XA_PRIMARY, if it does not break the system; selecting would either copy to XA_CLIPBOARD or better: do nothing because personally I use selection as a bookmark to remember where I am while reading a specific page on Firefox; but this is not a concern for the Geany bug tracker ;-)