GNU nano 8.0 released
GNU nano 8.0 released
Posted May 1, 2024 21:16 UTC (Wed) by sub2LWN (subscriber, #134200)In reply to: GNU nano 8.0 released by josh
Parent article: GNU nano 8.0 released
> executable (or a symlink to it) starts with the letter "e".
Does this mean nano could be installed as "emacs" to activate the new bindings? :-) Not that this would ultimately help users, of course.
Posted May 1, 2024 21:41 UTC (Wed)
by josh (subscriber, #17465)
[Link] (6 responses)
Posted May 1, 2024 22:33 UTC (Wed)
by fraetor (subscriber, #161147)
[Link]
Posted May 1, 2024 22:35 UTC (Wed)
by coriordan (guest, #7544)
[Link] (3 responses)
I found the mail where this change was announced on the dev list: https://lists.gnu.org/archive/html/nano-devel/2023-02/msg...
...but the replies don't raise or answer your question. I guess it's just an arbitrary decision between two fine options.
Posted May 2, 2024 0:47 UTC (Thu)
by sub2LWN (subscriber, #134200)
[Link] (2 responses)
if (*(tail(argv[0])) == 'r')
So the logic was likely based on the restricted code (which is also in nano 2.9.8 which I have on my system). Unfortunately it's mutually exclusive :-( can't invoke nano as "err" and have a restricted editor with modern bindings.
"git blame nano.c" says the earlier argv check for restricted mode was added 2017-12-29 so perhaps there's more rationale in an old changelog or message somewhere.
Posted May 2, 2024 5:29 UTC (Thu)
by NYKevin (subscriber, #129325)
[Link] (1 responses)
Posted May 3, 2024 5:43 UTC (Fri)
by grawity (subscriber, #80596)
[Link]
Spinning up a new VM for each user wasn't an option back then.
Posted May 1, 2024 23:00 UTC (Wed)
by sub2LWN (subscriber, #134200)
[Link]
My first thought was to overload argv to make distinct instances of the e* editor (as I'll now remember nano), such that you could kill a particular one when several are running (elinux, eblog, ecommerce, enlightenment).
I tried "$ (exec -a en nano)" in bash, and that seems to change argv and /proc/self/cmdline for that process to the new name. I don't have the new e* v8 yet to check the modern bindings however.
(Un)fortunately this doesn't affect the likes of "pgrep electricnano" by default, and needs "pgrep -f electricnano; pkill -f electricnano" to use the process cmdlines. I suspect this is due to /proc/self/exe being a symlink to the real path, and the design of certain tools limiting trust in user inputs to prevent complete chaos. The given argv 0 does show up in "ps a" and "systemctl status".
GNU nano 8.0 released
From the commit message:
GNU nano 8.0 released
This allows activating the "modern" bindings without having to pass an
option, by simply invoking nano through a symlink -- for example: `en`
(short for "editor nano"), or `et` (short for "edit"), or just `e`.
GNU nano 8.0 released
GNU nano 8.0 released
SET(RESTRICTED);
else if (*(tail(argv[0])) == 'e')
SET(MODERN_BINDINGS);
GNU nano 8.0 released
GNU nano 8.0 released
GNU nano 8.0 released