News for hackers. Stuff that matters.
Re:micro – A Modern Alternative to nano by cesarb on Friday August 18, 2023 @12:50PM (#37178419)
> There are some greybeard linux admins who absolutely refuse to let someone use anything other than vi. I never got that.

When I first encountered nano, I found out that it could silently corrupt configuration files (by word wrapping long lines) unless you were very careful to always start it as "nano -w". Since then, I've always removed nano (or at least set something else as the default editor) on every Unix system I administer.

Re:micro – A Modern Alternative to nano by zamadatix on Friday August 18, 2023 @01:39PM (#37179288)
"-w" changes visual wrapping, it doesn't save that way. No different than the behavior of "cat" in an interactive terminal really, beyond the temptation for editor religion.
Re:micro – A Modern Alternative to nano by cesarb on Friday August 18, 2023 @02:07PM (#37179728)
> "-w" changes visual wrapping, it doesn't save that way. No different than the behavior of "cat" in an interactive terminal really, beyond the temptation for editor religion.

What you mentioned is "soft wrapping", which is visual only but doesn't affect the saved file. But the default for nano when I first encountered it was "hard wrapping", which does affect the saved file. Some distributions later changed the default in the nano configuration file, but depending on the configuration file instead of a built-in default is risky. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=135978 (and the five other bug reports merged into it) for an example of the problems caused by running nano in the default configuration without disabling its line wrapping.

Re:micro – A Modern Alternative to nano by zamadatix on Friday August 18, 2023 @04:29PM (#37181672)
I stand corrected on the wrap behavior of the original nano 1.x. Softwrap and the default wrap mode change weren't added until later.
Re:micro – A Modern Alternative to nano by swozey on Friday August 18, 2023 @04:32PM (#37181693)
That's interesting. I haven't ever had that problem. I have had a ton of problems with zsh adding characters to things like SSL certs (I forgot, maybe an ending %?) where I had to switch back to bash to base64 encode/decode it properly.

I write the standards for our engineers to follow/emulate/consider. I don't have very much for nano but this is what I put into every containers userdata scripts. I can't get this curl command to show up correctly.

  # Add syntax highlighting and line numbers to nanorc, need to fork syntax repo so we're not installing random git repos

  curl 
https://raw.githubusercontent.com/scopatz/nanorc/master/inst... | sh

  {
  echo set constantshow
  echo set linenumbers
  } > ~/.nanorc
Re:micro – A Modern Alternative to nano by rascul on Friday August 18, 2023 @12:57PM (#37178531)
If I recall correctly that default changed awhile back. One could also set it how they want in nanorc.

However, I do understand the criticism, and how that could leave a bad first impression.