zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.77k stars 123 forks source link

feat: refactor ls, list, and loaded commands #497

Closed vladdoster closed 1 year ago

vladdoster commented 1 year ago

Description

Issues addressed:

  1. Confusing and unintuitive command names

    Currently, two commands loaded and list will list installed plugins and a single command ls lists installed snippets. The names don't make much sense or give context to their behavior, nor does having two commands with identical behavior.

This PR removes the three commands in favor of two new commands snippets and plugins. The names align with the action they perform.

  1. Uninformative output

    Current output is hard to grok.

This PR cleans up the output format and uses color to help convey information.

  1. Incorrect

    Output does not account for various situations with the only way to fix is to reload Zsh session which would not always fix it. See images below for the aforementioned situations.

Note: PR changes on left, Zinit main branch on right

Screenshot 2023-04-09 at 19 03 11 Screenshot 2023-04-09 at 19 09 44

How Has This Been Tested?

Types of changes

Checklist:

vladdoster commented 1 year ago

This bug shown in the images below was the catalyst for this PR.

This could be viewed from two angles.

  1. Yes, even though the source code is "deleted", the session retains functionality for the most part (e.g., gh-r are gone but zsh plugin still works) due to (shooting from the hip here) that the underlying C code is still in memory. So does reporting no changes after deleting wrong?
  2. Once a plugin is deleted, it is considered not loaded even though the current shell retains the functionality.

... I need a 🚜 as I'm obviously in the weeds and being pedantic ...

Before

Screenshot 2023-04-10 at 03 04 53

After

Screenshot 2023-04-10 at 03 14 01

The scope creep was strong with this one.

vladdoster commented 1 year ago

You might have wondered why I use the particular style and colors I do. It is heavily inspired by brew.

For example:

Screenshot 2023-04-10 at 06 35 38
github-actions[bot] commented 1 year ago

:tada: This PR is included in version 3.11.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: