New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add operating system module #4109
Conversation
refactor(os): calculate variables in dedicated functions
I have only had a quick look but think we need to think about the default configuration here we are moving away from using nerd fonts (see #3544). However happy to see this module happening we seem to get a lot of questions/requests for this feature. |
Ah, well I have exactly what you request (probably)! I spent a good few hours coming up with a reasonable list of emojis that represent the operating systems instead of nerd font. I have yet to finalize my edits to the Presets themselves, but you can see the emoji list is implemented as one of the |
docs(os): Use emoji as default
test(os): Use emoji as default
I'm not quite sure how to handle updates to the |
I think a comment is fine, most popular os-types are already covered. Maybe a macro can handle detecting this? |
docs(os): Remove `bitness` variable test(os): Remove `bitness` test
* leave missing case to test github tests
* style(os): fix formatting
- docs(os): add missing garuda to config - test(os): mention docs updates in warn_on_os_info_update
@davidkna I think the CI tests screwed up? Could you run them again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@andytom @exincore It's inspiring that Nerd fonts have actual logos for OSes: There are Windows and Apple logs too. What about to utilize them instead of standard emojis? You already use Nerd-specific symbols for Rust and NodeJS and other. Here is how I trick the shell module: Although, I find pretty convenient to use specific brand icons for From this point of view, it would be cool to introduce an |
@fadeevab The list of Nerd Font operating system symbols is provided within the preset "Nerd Font Symbols"; one may copy the As for implementing In this case, Fedora with Fish. |
@exincore Gotcha. If you don't mind, I have a question: now, the UPD: Just used your way using both |
@fadeevab I apologize for the delay. I would suggest bringing these topics up in the Starship discord server. I am merely a lowly contributor and I do not manage design decisions. |
* docs(os): Add os module documentation * docs(os): Add os to Default Prompt Format * chore(os): Update config file schema * feat(os): Add os entries and declarations * feat(os): Add os module and config * fix(os): Obey config.disabled * feat(os): make variables 'Unknown'-aware refactor(os): calculate variables in dedicated functions * test(os): Add os module tests * feat(os): make 'name' variable less 'Unknown'-aware * docs(os): Add Preset configurations docs(os): Use emoji as default * feat(os): Use emoji as default test(os): Use emoji as default * fix(os): Add spaces after emoji symbols * chore(os): Update config schema * feat(os): Remove `bitness` variable docs(os): Remove `bitness` variable test(os): Remove `bitness` test * feat(os): Add Cargo.toml upgrade caution for os_info * refactor(os): Clarify get_symbol function * docs(os): Mention supported operating systems and feature requests * docs(os): Mention os_info inacurracy * test(os): Remove `bitness` leftovers * refactor(os): use nu_ansi_term * refactor(os): add cfg_attr(schemars(deny_unknown_fields)) * chore(os): update config schema * docs(os): expose details block * feat(os): add garuda linux * chore(os): update config schema * feat(os): add case insensitivity * feat(os): add symbols `IndexMap` use `os_info::Type` instead of `String` * test(os): add clippy warn on new os_info::Type case * leave missing case to test github tests * test(os): re-add missing test case * style(os): fix formatting * docs(os): update to match os_info::Type serialization - docs(os): add missing garuda to config - test(os): mention docs updates in warn_on_os_info_update
Description
The
os
module shows the current operating system.OS information is detected via the os_info crate.
Disabled by default due to
os_info
inaccuracies for the time being.NOTE: os_info v3.5.0 should have much improved detection, but this remains to be confirmed
Motivation and Context
Inspired by
os_icon
'segment' of romkatv/powerlevel10kFixes #4292
Screenshots:
How Has This Been Tested?
Checklist: