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 ?

1 Answer 1

1

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
5
  • I had seen something about xclip in my research but unfortunately I do not have root privileges to install it... Commented Aug 18, 2017 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. Commented Aug 18, 2017 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 ! Commented Aug 18, 2017 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. Commented Aug 18, 2017 at 21:29
  • 1
    While this might be a useful (?) workaround, xclip is not the way to fix a bug.
    – holdenweb
    Commented Feb 8, 2018 at 9:25

You must log in to answer this question.

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