you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 1 year ago (2 children)

Sudo uses the setuid bit or whatever, so it still has access to the user's environment variables and whatnot. So figuring out which editor to run shouldn't be an issue.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 1 year ago (1 child)

    That's not what I mean. Yeah, getting the environment variables are simple enough, but if you simply exec something as the root user, whatever you exec will naturally be looking for configs in /root/.config and not your ~/.config dir, so any configurations to things like your text editor won't be read.

  • source
  • parent
  • hideshow 1 child comment