doomemacs / doomemacs/core

Emacs hangs when using `SPC f u` after replacing `sudo` with `doas`

Open
#7,124 8 comments 2 reactions 0 assignees View on GitHub
core:lib is:feature
Dominant language
Emacs Lisp
Stars
22.7k
Forks
3.1k
Avg merge
10h 46m
Merged PRs (30d)
4

Description

### I confirm that...

- [X] I have searched the [issue tracker](https://github.com/doomemacs/doomemacs/issues), [documentation](https://docs.doomemacs.org), [FAQ](https://docs.doomemacs.org/-/faq), [Discourse](https://discourse.doomemacs.org), and [Google](https://google.com), in case this issue has already been reported/resolved.

- [X] I have read "[How to Debug Issues](https://doomemacs.org/d/how2debug)", and will use it to provide as much information about this issue as possible.

- [X] The issue can be reproduced on the **latest** available commit of Doom.

- [X] The issue can be reproduced on a stable release of Emacs, such as 27 or 28. *(Doom does not support development builds like 29+ or any version ending in .50 or .9x)*

### Expected behavior

When using the `SPC f u` shortcut in a Linux system with `doas` installed in place of `sudo`, Emacs should automatically recognize the environment and launch the correct tramp address.

### Current behavior

Emacs always tries to launch `sudo` with the operation resulting in the `Tramp failed to connect. If this happens repeatedly, try 'M-x tramp-cleanup-this-connection'` and `env: 'sudo': No such file or directory` errors (followed by a hang).

### Steps to reproduce

1. Uninstall `sudo` and replace it with `doas`
2. Open Emacs
3. Execute the `SPC f u` shortcut to open a file as root
4. Select a file
5. See the error

### System Information

https://privatebin.devol.it/?69e7ac380b0381f7#7wozTc8HLtU7bqH11wQr57Jmyzak4af3LmKVtpA4XU33

Contributor guide

Open the contributing guide

Research direction

Start with the `SPC f u` entry point and inspect how it selects the Tramp address when `sudo` is unavailable. Reproduce the failure on a Linux system using `doas`, then trace the resulting Tramp connection error and hang. Done means opening a file as root succeeds through `doas` without attempting `sudo` or hanging.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs, emacs-lisp, linux
Domain
desktop, operating-systems, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.