Visudo and pacdiff still default to vi

Hey folks,

Believe it or not, this is my first topic created. :flushed:

I thought I would pass along a small piece of feedback that popped into my head and see what you guys think. I feel like it could help improve Garuda in a (very) small way.

visudo uses vi by default, which is a package not included with Garuda. To run visudo a Garuda user needs to either download vi, or run sudo EDITOR=/usr/bin/micro visudo to get it open and then add Defaults editor=/usr/bin/micro into the file somewhere if they don't want to have to remember that whole line every time.

I don't intent to imply this is a great hardship, but since micro is the default editor it seems logical that visudo would open with micro by default. A user who does not prefer micro could make their own adjustments, which they will already be doing for the rest of the editor defaults.

My suggestion would be to ship Garuda with Defaults editor=/usr/bin/micro as an uncommented line in the visudo file, or put the equivalent line in ~/.bashrc or /etc/environment or whatever is determined to be the most reasonable way to accomplish this.

In the same vein, pacdiff also defaults to vi on a stock Garuda install, and requires either downloading vi or running as sudo DIFFPROG=micro pacdiff. It would be nice if you could just...run it!

I don't believe these are incredibly critical changes to make, but I do think they are nice-to-haves that are acheivable--perhaps even easy. What do you guys think?

5 Likes

As always, some say so and others so :slight_smile:
I have an alias for it for years.

alias pacdif='sudo DIFFPROG=micro pacdiff'

But I'm not sure everyone wants that under helpful alias :smiley:

I am so sorry, post from phone without first coffee :slight_smile:

alias pacdif='sudo -H DIFFPROG=meld pacdiff'

I'm getting too old for this stuff :wink:

5 Likes

This will fix the issue for visudo :slight_smile:

5 Likes

Just a note on that, after updating I am getting

--> Updating AUR packages with paru..
/etc/sudoers.d/editor:1:10: syntax error
Defaults EDITOR=/usr/bin/micro
^
:: Looking for AUR upgrades
:: Looking for devel upgrades
:: orphans: lockdown-ms
there is nothing to do

/etc/sudoers.d/editor:1:10: syntax error
Defaults EDITOR=/usr/bin/micro
^
Parsing man pages and writing completions to /home/richard/.local/share/fish/generated_completions/
3205 / 3205 : zramctl.8.gz                                        

/etc/sudoers.d/editor:1:10: syntax error
Defaults EDITOR=/usr/bin/micro

and

╭─richard@thorgdr460n in ~ as 🧙 took 56s
╰─λ sudo micro /etc/sudoers.d/editor
/etc/sudoers.d/editor:1:10: syntax error
Defaults EDITOR=/usr/bin/micro
         ^

As an env variable it will accept it, but in its config wants Defaults editor=/usr/bin/micro.

6 Likes

Oh boy, I tested it locally with lowercase and committed with uppercase. Thanks for being attentive :slight_smile: Just fixed that.

6 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.