Commit Graph

9 Commits

Author SHA1 Message Date
Artyom Belousov 61438484bd
feat(status): Add pipestatus_segment_format option to status module (#4103)
Add pipestatus_segment_format
2022-07-19 15:07:50 +02:00
David Knaack 18ad26f98d
feat: allow printing config file schema (#3737) 2022-04-01 17:14:05 +02:00
David Knaack 2d4b183fce
refactor: replace module_config_derive with serde (#3786)
* refactor: replace module_config_derive with serde

Changes include:
* Removing `starship_module_config_derive` and replacing it with `serde::Deserialize`
* Removing `RootModuleConfig::load_config`. While potentially useful, it was only used in tests. And it would require something like `serde::DeserializeSeed` which is not derived by serde.
* Merging `RootModuleConfig` into `ModuleConfig`
* Implementing a `ValueDeserializer` that holds a reference to a `toml::Value` in `serde_utils.rs`
* Deserialization errors (invalid type) are now logged and include the current key and the struct names
* Unknown keys are now considered an error. "Did you mean?"-messages are still possible

* fix typo

Co-authored-by: Matan Kushner <hello@matchai.dev>

Co-authored-by: Matan Kushner <hello@matchai.dev>
2022-03-26 10:42:19 +01:00
Izhak Jakov 86953272a7
fix(status): Make status module work even when the status is 0 (#3750)
Co-authored-by: Izhak Jakov <jizhak@ca.ibm.com>
2022-03-16 16:05:13 -04:00
Hugues Morisset 40cb667b9d
feat(status): Add pipestatus display in status module (#2481)
* feat: Add pipestatus display in status module

This MR is based on this one https://github.com/starship/starship/pull/370

* Documentation

* Add a test with map_symbol false

* Handle bash preexec pipestatus

* Add zsh support

* Add fish support

Thanks kidonng for the diff patch

* Rename sucess_symbol to success_symbol
2021-07-28 12:26:00 -04:00
David Knaack d06ba072a8
feat(config): allow printing default and computed config (#2521)
* feat: allow printing default and computed config

* fix custom modules

* actually fix custom modules
2021-03-31 17:31:55 +02:00
David Knaack 052b56fe10
refactor: replace RootModuleConfig with Default (#2458) 2021-03-15 11:40:52 +01:00
Hugues Morisset cfff77043e
feat(status): Convert known status code to their meaning (#1948)
User is able to choose if their want to display the meaning of known status code in place of number.
2021-01-02 21:09:13 -06:00
Jan Katins ffb1345052
feat(status): add the status module (#1651)
* add the exit code module

this allows to display more precisely the last command exit code
and to configure starship to not change the last charcter of the
prompt even in case of failure. It is disabled by default, because
it seems a bit redundant with the character module in its default
configuration.

* rename exit_code module to status

* Enforce a default disabled=true 

In the outer places, we only check for the disabled flag in the config toml file, only when this is loaded into the real config struct, we see the default. And if the default is true, we have to abort at that place. For status and hg_branch that wasn't so. I also commented the rest

* fix spaces in markdown table for status module

* Add a tip that status module is disabled by default

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>

* Remove unrelated changes for default disabled=true

Co-authored-by: Gaëtan Lehmann <gaetan.lehmann@gmail.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-09-26 00:04:51 +02:00