2

I'm having a weird bug recently (RHEL 6.4). When I select text in a gnome terminal, I am unable to copy it in any fashion (middle click, ctrl+shift+c ctrl+shift+v or right click -> copy right click -> paste do not work). It seems the copy buffer from the terminal is not working properly, but I have no clue how to investigate further...

Restarting my session could potentially solve it, but I have some text output in a terminal that I would like to keep and process that would be lost by doing so (my bad for not tee-ing it to a file...). Copying and pasting in other windows (gedit, firefox...) works as intended. Copying from another program to a terminal also works. Really the problem seems to be that selecting text in a terminal does not store it in the appropriate buffer.

How could I reset the copy buffer from the terminal ?

At least, is there a way I can salvage the text output in my terminal to a file, so that I could restart my session and not lose my work ?

0

You might also try xclip for copy pasting through terminal.

For copying your file to the buffer, do

cat file1 | xclip -selection clipboard

For pasting the copy buffer to some other file, do

xclip -selection clipborard -o >> file2
  • I had seen something about xclip in my research but unfortunately I do not have root privileges to install it... – Valentin B. Aug 18 '17 at 9:40
  • Then you might have to run that command which gave you the output on terminal again and store the output in another file this time. Sorry, I don't have a solution other than that. Someone else might be able to help. – GypsyCosmonaut Aug 18 '17 at 9:46
  • Yes if noone comes up with some arcane knowledge on gnome terminal buffer, I will probably resort to that... Thank you for your input though ! – Valentin B. Aug 18 '17 at 9:47
  • That won't help. xclip can manipulate the clipboard, but the problem here is to extract the data from Gnome-terminal, and xclip can't do anything about this. – Gilles Aug 18 '17 at 21:29
  • While this might be a useful (?) workaround, xclip is not the way to fix a bug. – holdenweb Feb 8 '18 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.