Bug 528359 - disable line wrapping by default
Summary: disable line wrapping by default
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nano
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-11 15:27 UTC by Iain Nicol
Modified: 2009-12-07 07:34 UTC (History)
3 users (show)

Fixed In Version: 2.0.9-4.fc12
Clone Of:
Environment:
Last Closed: 2009-10-13 12:33:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.