bugGNU nano - Bugs: bug #54864, [Request] the ability to specify a...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #54864: [Request] the ability to specify a config file on the commandline

Submitter:  Rob Munsch <robmunsch>
Submitted:  Thu 18 Oct 2018 05:19:00 PM UTC
   
 
Severity:  3 - Normal Status:  Need Info
Assigned to:  None Open/Closed:  Closed

Mon 25 Mar 2019 01:46:33 PM UTC, comment #2: 

Closing due to lack of response.  The suggestion to replace «SYSCONFDIR "/nanorc"» with «"/whatever/path/you/like"» (in src/rcfile.c on line 1238 in version 4.0) would appear to achieve what the original poster desires.

Benno Schulenberg <bens>
Group administrator
Sat 20 Oct 2018 08:55:35 AM UTC, comment #1: 

I don't understand the request.  You say you made a "Module" for nano.  Does that mean that you compile nano yourself, and use the most recent version?  If so, then you could patch nano and change the SYSCONFDIR "/nanorc" to "/whatever/path/you/like" (in src/rcfile.c around line 1228).  Then your self-compiled nano will always load the specified config, and the user can still override it with their local .nanorc file.

Because if we would make an option that specifies the config file to be read, it would mean that nano would read only that config file and nothing else -- the user's nanorc file would not be read, because most likely it was the user who specified the config file on the command line, so why read anything other than that file?

(The baked in reading order of config files is: first /etc/nanorc is read if it exists, and then the first file from ~/.nanorc, $XDG_CONFIG_HOME/nano/nanorc, ~/.config/nano/nanorc that exists is read.  So normally nano will read two config files: the system's nanorc and the user's nanorc.)

Benno Schulenberg <bens>
Group administrator
Thu 18 Oct 2018 05:19:00 PM UTC, original submission:  

Hi,

-- TL;DR
It seems like nano's search order of where to find a config is baked in; /etc/nanorc, nano/.nanorc, and finally ~/.nanorc - with no option to point it somewhere specific. It would be awesome to be able to customize that

-- Why???
We're using (a ton of) Modules in a clustered environment; I've made one for nano, as the standing order here is to alter the base distro machine as little as possible (and the baseline nano is, for some reason, ancient).

It's also nice to have a uniform version of nano across all the various nodes and servers I'm constantly logging in to.

The issue is that even with my environment automagically loading my centralized, single-install nano module, it's looking locally for its config. It either uses the system default, whose version can vary by system and may not be the same as the module I'm loading; or in ~, which is not so bad for a normal user on a shared file system but becomes annoying when you think about managing each /root/ with its own copy.

If I could "pair" a specific nanorc with my module, then I could specify default settings that're valid for that version, without worrying about clobbering the system default and/or throwing errors on a mismatch.

The goal would be to put a cluster-wide default nanorc in one place on shared storage and not refer to the local node or server at all (except in the case of a user's .nanorc, which would still override as normal).

-- Why don't you just update nano on all the nodes?
BOY I'D LIKE TO

Rob Munsch <robmunsch>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by robmunsch (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-25 bens Open/ClosedOpen Closed
    2018-10-23 bens StatusNone Need Info
    2018-10-20 bens Summary[Request] Ability to specify a nonstandard config file, such as on the commandline [Request] the ability to specify a config file on the commandline

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code