Skip to content

fish_is_root_user only checks $USER but not actual uid #8866

@septatrix

Description

@septatrix

fish, version 3.4.1

The list for which the red root prompt is chosen is hardcoded and can lead to false positives and negatives.
Special purpose distros and containers sometimes use an uncommon root username which is not in the current list.
On the other side there might be users coming from windows which are used to having an "Administrator" account set up manually which will not have a uid of 0.

While this function is only used for prompts currently it can still be confusing.
Instead it should simply check if test (id -u) = 0 holds true.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions