Bug 528359

Summary: disable line wrapping by default
Product: [Fedora] Fedora Reporter: Iain Nicol <iain>
Component: nanoAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: dwmw2, jaswinder, kdudka
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.0.9-4.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-10-13 12:33:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Iain Nicol 2009-10-11 15:27:51 UTC
By default, nano hard wraps long lines.  This is a problem for editing /etc/fstab, for example.

A workaround is to invoke as "nano -w" or to add "set nowrap" to the config file.  But nano supports --disable-wrapping-as-root being passed to configure.  This lets commands like
   su -c "nano /etc/fstab"
or
   sudo nano /etc/fstab
work as expected.

Unfortunately, this doesn't help commands like
   sudo -e /etc/fstab
when nano is $EDITOR, because here sudo creates a temp file, and invokes the editor with the user's normal permissions.  For this reason Debian builds nano with --disable-wrapping (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=513443), though this might not be the right trade-off for Fedora.

Comment 1 Kamil Dudka 2009-10-11 16:07:53 UTC
Thanks for pointing this out! I am fine with changing the default, but there is no reason to limit the functionality of nano. Let user make the final decision if wrap or not wrap. This simple command solves the problem for me:

# echo set nowrap > /etc/nanorc

We can ship such file along with the nano package. What's your opinion?

Comment 2 Iain Nicol 2009-10-11 17:04:29 UTC
Yup, that works, and I'd be happy with it.  Thanks.

(I think "unset nowrap" can undo the effect of --disable-wrap, but an advantage of your suggestion is that it's clearer that the default behaviour's being overridden.)

Comment 3 Kamil Dudka 2009-10-11 17:21:13 UTC
(In reply to comment #2)
> Yup, that works, and I'd be happy with it.  Thanks.

No problem, I'll do a build for F-13 next week.

> (I think "unset nowrap" can undo the effect of --disable-wrap, but an advantage
> of your suggestion is that it's clearer that the default behaviour's being
> overridden.)  

Nope, this can't work since the wrapping code is not compiled at all with --disable-wrapping. It's easy to give it a try.

Comment 4 Kamil Dudka 2009-10-13 12:33:50 UTC
built as nano-2.0.9-5.fc13

Comment 5 Fedora Update System 2009-11-18 17:56:24 UTC
nano-2.0.9-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/nano-2.0.9-4.fc12

Comment 6 Fedora Update System 2009-12-07 07:34:33 UTC
nano-2.0.9-4.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.