-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nano: set default shell editor to nano #25636
base: master
Are you sure you want to change the base?
Conversation
The default editor for the system is vi this exports the EDITOR shell variable as nano. Utilities like crontab that respect EDITOR will use nano by default. Signed-off-by: Anthony Sepa <[email protected]>
What makes you believe that every user who installs nano wants to use it as |
Good point! It would make sense to make the most popular package the default one. My hunch is that nano gets installed more often than mg, joe and jupp combined. I couldn't find any recent package statistics, @hnyman do you have an idea how to check? |
I disagree. Even if the others are less popular, some users will still prefer them over whatever is the most popular editor. With such a hard config, how would these people change their preference? To solve this issue properly, you would copy Debian's #!/bin/sh
if test -n "${EDITOR-}"
then
:
elif test -s ~/.myeditor
then
read -r EDITOR <~/.myeditor
else
EDITOR=vi
fi
exec "${EDITOR}" "$@" Users can then choose whichever editor they like most by just writing it's name or path to |
Same way they change their preference now? |
This change only effects if nano is installed. If you don't want nano don't install it. Is there really a large use-case for installing more then one editor? |
I am just thinking that how common are the actual benefits in OpenWrt context? Which utilities actually utilise that variable to launch an editor? Crontab was mentioned, but what else? |
git will use EDITOR variable |
Wow, this seems to have become complicated real fast. I figured that for the vast majority of people who specifically install nano as an editor they would want it to be used by any tools that are installed by default (crontab) or that they install themselves (git, I guess). This change allows that use-case to be automatically set up. Who installs two or three editors on their router, just in case they need them? Why would that individual user stop the vast majority of users from having nano setup as the default. I named the profile |
Good point. OpenWrt already ships an editor (vi) installed by default. Why do you need another one?
Systems are not always only used by one person. There may be multiple admins with different preferences.
You can also turn this the other way round: how does your preference for nano justify the additional work created for other users who now need to remove this profile file after every sysupgrade?
So your suggestion is that I now open a PR for mg to install The problem with your PR in my eyes is not that it introduces a way to configure a different Another thing to take into account: if you replace Dropbear with OpenSSH there exists the possibility of |
I don't. I always assumed people install nano, vim or whatever as a replacement for vi. Whatever they install they want to use as a default. So let's set it up as a default editor.
I feel this is just letting the minority getting in the way of the majority, who just want a replacement for vi and want it setup as such.
I think this is just a repeat of more then one person administrating a router. Unless there are individuals who use nano for script editing, vim for config editing and vi for plain text files. Who installs nano (or any second editor) not to be used.
Sure if you want to. Up to you. There could be some type of co-ordination or complicated logic to pick the right editor, but why? For the ten people who install vim (pick any editor) and nano? Keep it simple.
Again, I don't understand your point. It's for anyone who wants to replace the vi with nano (because this is a nano package change). For people who prefer vim (or any other editor) they can implement the same. It only is a problem in your router needs many different editors, scenario. Which I find to be very low usage, sand even then it can be solved. The first time they try to use the default editor it will use nano and they can override the EDITOR setting in their profile.
Again this is just a repeat of the many people administration the same router (oh and they all want to use different editors) scenario. Which again I find as very low usage. |
The default editor for the system is vi this exports the EDITOR shell variable as nano. Utilities like crontab that respect EDITOR will use nano by default.
Maintainer: Hannu Nyman [email protected]
Compile tested: ipq40xx, generic, asus_map-ac2200
Run tested: 24.10-rc2
Description:
Simple change that creates an
/etc/profile.d/nano.sh
file withexport EDITOR=/usr/bin/nano
.