Skip to content

Displaying file type and git status in ls #7612

@KodiCraft

Description

@KodiCraft

Related problem

Modern alternatives to ls such as lsd or exa usually display additional helpful contextual information allowing the user to understand at a glace what each file is and its status. This includes an icon that illustrates the file's mime type (for instance, an icon of a picture for image files) and/or a letter or symbol representing the file's git status (for instance, "M" for a file that has been modified since the last commit). Providing this information in the default ls command would make it generally more versatile for users and provide much more flexibility in scripting. For instance, a user could make a script iterating over untracked files of a git repo, or a script that only executes on image/* files.

Describe the solution you'd like

Allowing the type column in ls to display the mime type of a file, with an optional flag to return to the "legacy" option of simply displaying "file".

Adding a git status column displayed when the directory is in a git repository indicating the file's git status.

Describe alternatives you've considered

No response

Additional context and details

I am already working on a simple fork implementing these features on Linux as it's a feature I wanted on my own personal version, though I believe it could be interesting for it to be implemented upstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions