0

I am using terminal mode in two Linux machines using Ubuntu 18.04. On my laptop I navigate with a touchpad equipped with a left and right select button. I have a file on first machine that I want to copy to the second machine. I have tried successfully using scp to copy the file from first machine to second machine. I have also tried cat file on first machine, Ctrl-C select/copy then on second machine I open nano editor and I do a right click from the touchpad and the contents are copied. All selected content seems to copy fine, both scp and Ctrl-C except for the remarks with multiple same characters. For example:

#########################################
//------------------------------------------

are copied over as:

#
//-

Respectively It doesn't seem to affect the running code and in .c files gcc works just fine. However, if I try to edit the copied code nano editor acts strangely like the characters are hidden, they will show then become hidden, etc. as I try to delete and edit them including Ctrl-k in nano editor. Is there a work-around or is this even considered an issue. I have searched around but don't see anything related to multiple characters issues. Thanks for input.

  • So what is your question? Do you want to copy a file from machine A to machine B? That is what I read. And you seem to get into trouble doing that, and now try to fix it via copy/paste. That is not the way to do this. If you want to copy a file, try rsync. – SPRBRN Dec 1 at 15:42
  • Is Nano running with syntax highlighting? – Michael Harvey Dec 1 at 19:57
  • Hello SPRBRN, sorry for the confusion. My question is, what can I do to prevent those characters from disappearing. I can copy the whole file from A to B using scp, I have no problem doing that. What I am concerned with is that after the file copy or even after a copy/paste those characters using nano editor are shortened or missing. If I cat the copied or pasted file cat shows the characters are there. It's that nano editor does not recognize them. – WesZ Dec 2 at 11:20
  • Hello Michael. Yes nano editor is using syntax highlighting. – WesZ Dec 2 at 11:23
  • There are many places where the characters could be lost. There are tools to check the clipboard contents on all relevant machines. – xenoid Dec 2 at 12:52

Your Answer

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

Browse other questions tagged or ask your own question.