0

I have somehow altered my setup such that editing text files in nano via PuTTY is line wrapping. I have tried numerous suggestions for forcing the nano editor to not wrap lines.

My latest attempt was to format the microSD card and re-install the Jessie image afresh. It is still happening, so it has to be something in PuTTY or the text itself.

I am editing my file using sudo nano myfile.txt, and then right clicking to paste the text. I should get 761 lines, but I am getting 1786 instead.

This did not used to happen. How did I get into this state, and how do I make it stop? Is there any other information I can provide that will be helpful?

EDIT: I checked the nanorc configuration file, and the set nowrap command/line is uncommented, thus I would expect the text to NOT wrap.

11
  • Does it happen only for root (when you use sudo nano) or for any user? If it's a Putty setting (which I suspect is responsible) you could clear the settings from the registry (after exporting them) so that you start with a clear slate.
    – Dirk
    Nov 16, 2018 at 17:52
  • ` re-install the Jessie image afresh.` Maybe nothing to do, but why Jessie and not Stretch?
    – Dirk
    Nov 16, 2018 at 17:56
  • Dirk, I've never done it as anyone but sudo. I can change the file permissions and try it as a standard user. I used Jessie originally (years ago) and just wanted to keep the same install. This is a bot Pi and I really don't need it to do much at all. No desktop or VNC. It just does its job and I leave it alone other than editing this file. I'm sure open trying stretch though. This has been driving me nuts for weeks.
    – DJGray
    Nov 16, 2018 at 18:01
  • I note that stretch lite is for older Pi hardware. This is a Pi3. I assume that would still work and be all I need?
    – DJGray
    Nov 16, 2018 at 18:03
  • I note that stretch lite is for older Pi hardware. What makes you think that? All RPF Raspbian image downloads will run on any model Pi (and that includes the 3A+ that came out yesterday)
    – Dirk
    Nov 16, 2018 at 18:20

2 Answers 2

0

While I still get the line wrap in Nano, I have resolved this, or created a workaround, by punting PuTTY (a shame, because I like it) and installing BitVise. What this allows me to do is to work with my text files locally, and using BitVise, drag & drop them onto the Raspberry. It's a total hack approach, but it gets me what I need.

0

Have you tried it with a different file (other than myfile.txt)? What does wc -l myfile.txt tell you the line count is? It might well be that the linewrap is a visual artefact only and is not an actual reflection of what's being saved to your file.

You could also try cat or less on the file to manually check it outside of nano?

Finally, could the text you are pasting contain some stray line ending characters from another OS that might be confusing nano.

EDIT: Forgot to add: in your PuTTy settings check under "Terminal" section for the "Auto wrap mode...", "Implicit LF..." and "Implicit CR..." options.

PuTTy configuration, Terminal settings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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