Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107877 - default EDITOR, "/bin/nano" doesn't disable line wrapping
Summary: default EDITOR, "/bin/nano" doesn't disable line wrapping
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: SpanKY
URL:
Whiteboard: .
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-02 04:57 UTC by Alex Jones
Modified: 2005-10-04 03:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Jones 2005-10-02 04:57:41 UTC
When doing "sudo -e /etc/whatever" to edit config files I noticed it was
wrapping lines. Yes, "sudo nano -w /etc/whatever" works fine but wouldn't it
make sense to change line 13 of /etc/rc.conf to read:

EDITOR="/bin/nano -w"

I've made this change myself and have no problems now.

Or would this have side-effects that I don't quite understand?

Cheers

Alex

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 SpanKY gentoo-dev 2005-10-03 06:11:07 UTC
it would affect everyone, not just root

also, some programs execute $EDITOR assuming it contains no arguments, so this
change would also break that ...
Comment 2 SpanKY gentoo-dev 2005-10-03 14:52:31 UTC
nano now builds with --disable-wrapping-as-root by default
Comment 3 Alex Jones 2005-10-03 17:14:27 UTC
Eek!

Erm, to tell you the truth I'm not too keen on that idea... hear me out.

How about instead of building it so that it behaves differently for different
users (think `crontab -e` for a normal user, that's gonna mess up, too)...

Build a text executable, and call it /bin/nanow or something, which is basically 

=============================
#!/bin/sh
nano -w $*
=============================

That way you can still pass parameters to it (although you can't cancel the -w,
if you want that use regular `nano`?

And we can use it as the EDITOR variable and applications that expect it to be
an executable will see it that way.

What do you think?
Comment 4 SpanKY gentoo-dev 2005-10-03 17:46:00 UTC
not worth the effort imo
Comment 5 Alex Jones 2005-10-03 17:59:20 UTC
OK, well we still have a broken `crontab -e` out of the box then... :( file a
separate bug for that?

Why do you think it's too much effort? nanow is easier to type than nano -w
anyway, and it's not like it requires much to hack a text executable into the
ebuild for nano, is it?
Comment 6 SpanKY gentoo-dev 2005-10-03 20:32:30 UTC
i dont see how `crontab -e` is broken

if you want to disable line wrappings, set 'nowrap' in your /etc/nanorc or
~/.nanorc or hit alt+l while running nano
Comment 7 Alex Jones 2005-10-04 03:54:17 UTC
'crontab -e' is broken for normal users as their EDITOR evar is '/bin/nano'. Try typing a cron line and it will wrap over.

I understand some people use text based mail apps which rely on EDITOR... so that complicates things. How do distros that default to vim cope?