Use the currently default system editor instead of mcedit #102

Closed
ngaro wants to merge 1 commit from systemeditor into master
ngaro commented 2024-08-05 18:58:54 +02:00 (Migrated from github.com)

The user should have the possibility to use an editor that he likes and not be forced to use mcedit.
On the rescue system (or other Debian/Ubuntu's) editor is /usr/bin/editor and a symlink to the current default editor.
The user can easily change this update-alternatives --config editor if he likes another editor better.

The user should have the possibility to use an editor that he likes and not be forced to use `mcedit`. On the rescue system _(or other Debian/Ubuntu's)_ `editor` is `/usr/bin/editor` and a symlink to the current default editor. The user can easily change this `update-alternatives --config editor` if he likes another editor better.
asciiprod commented 2024-08-07 13:15:51 +02:00 (Migrated from github.com)

Sorry, we cannot accept this PR. Doing so, would change the editor for installimage for everyone and setting editor to mcedit in our rescue system is also a breaking change.
The choice of mcedit is deliberate as it is very easy to use and obvious how to save and exit.
We understand it may not be the editor of choice for everyone.

Sorry, we cannot accept this PR. Doing so, would change the editor for installimage for everyone and setting editor to mcedit in our rescue system is also a breaking change. The choice of mcedit is deliberate as it is very easy to use and obvious how to save and exit. We understand it may not be the editor of choice for everyone.
ngaro commented 2024-08-07 14:01:47 +02:00 (Migrated from github.com)

And what if you set the default editor in the rescue environment already to mcedit ?
(Placing update-alternatives --install /usr/bin/editor editor /usr/bin/mcedit 50 in /etc/rc.local is already enough for this to work)
Would this PR be acceptable then ?

Advantages:

  1. By default no difference for users is visible
  2. Users that don't like mcedit can run a update-alternatives --config editor before running installimage
  3. mcedit is now the default editor in the rescue environment. (If it's really such a good choice then this is a good thing)
  4. The editorname is no longer hardcoded in the script
And what if you set the default editor in the rescue environment already to mcedit ? _(Placing `update-alternatives --install /usr/bin/editor editor /usr/bin/mcedit 50` in `/etc/rc.local` is already enough for this to work)_ Would this PR be acceptable then ? Advantages: 1. By default no difference for users is visible 2. Users that don't like mcedit can run a `update-alternatives --config editor` before running installimage 3. mcedit is now the default editor in the rescue environment. (If it's really such a good choice then this is a good thing) 4. The editorname is no longer hardcoded in the script
asciiprod commented 2024-08-07 14:08:31 +02:00 (Migrated from github.com)

Sorry, but as mentioned any changes would break expectations for all other users and so we do not accept any PRs here.

Sorry, but as mentioned any changes would break expectations for all other users and so we do not accept any PRs here.
ngaro commented 2024-08-07 14:33:23 +02:00 (Migrated from github.com)

Yet another idea:

This time it will literally not change anything to the default behavior. Not even the default systemeditor. Even this PR is no longer needed.

  • At the moment /usr/bin/mcedit is a direct symlink to /usr/bin/mc.
  • If you would put the following in /etc/rc.local : rm /usr/bin/mcedit && update-alternatives --install /usr/bin/mcedit mcedit /usr/bin/mc 20 the result would be that
  • /usr/bin/mcedit is a symlink to /etc/alternatives/mcedit and this in turn will be a symlink to /usr/bin/mc (So in practice mcedit is still a symlink to mc like it was before)

The only thing that is now "changed" (if you can call it a change) on the system is that users now have the option to do update-alternatives --install /usr/bin/mcedit mcedit /location/of/favorite/editor 30 to use the editor that they prefer.

Yet another idea: This time it will **literally** not change anything to the default behavior. Not even the default systemeditor. Even this PR is no longer needed. - At the moment `/usr/bin/mcedit` is a direct symlink to `/usr/bin/mc`. - If you would put the following in `/etc/rc.local` : `rm /usr/bin/mcedit && update-alternatives --install /usr/bin/mcedit mcedit /usr/bin/mc 20` the result would be that - `/usr/bin/mcedit` is a symlink to `/etc/alternatives/mcedit` and this in turn will be a symlink to `/usr/bin/mc` _(So in practice mcedit is still a symlink to mc like it was before)_ The only thing that is now "changed" _(if you can call it a change)_ on the system is that users now have the option to do `update-alternatives --install /usr/bin/mcedit mcedit /location/of/favorite/editor 30` to use the editor that they prefer.
asciiprod commented 2024-08-07 15:40:49 +02:00 (Migrated from github.com)

Again, I am sorry, but we have no plans to make such changes to the rescue system just to enable this. If you really cannot bear to use mcedit for, hopefully infrequent, installations, you can always use your favorite editor to create a config file and pass this to installimage using the -c option.

Again, I am sorry, but we have no plans to make such changes to the rescue system just to enable this. If you really cannot bear to use mcedit for, hopefully infrequent, installations, you can always use your favorite editor to create a config file and pass this to installimage using the `-c` option.
gartnera commented 2024-09-19 19:47:33 +02:00 (Migrated from github.com)

Thanks for the inspiration ngaro. I just did ln -sf /usr/bin/vim /usr/bin/mcedit to workaround this.

Thanks for the inspiration ngaro. I just did `ln -sf /usr/bin/vim /usr/bin/mcedit` to workaround this.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DiamantTh/installimage!102
No description provided.