* 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>
* fix: use e718 as the default of symbol in node configuration
* wip: change nodejs symbol in docs/config & add a nodejs symbol configuration in docs/presets
* wip: update CONTRIBUTING.md
* test: add mock method for absolute files
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
* feat(module): add a container indicator module
Adds a container type indicator, if inside a container,
detected via the presence of some marker files.
E.g. inside a podman container entered with `toolbox enter`
the prompt changes to the container name and version.
```
starship on container_rebased [$!] is 📦 v1.0.0 via 🦀 v1.56.1
❯ toolbox enter
starship on container_rebased [$!] is 📦 v1.0.0 via 🦀 v1.56.1
⬢ [fedora-toolbox:35] ❯
```
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
On Windows when running commands with their name instead of the path with Command::new, executable with that name from the current working directory will be executed.
This PR replaces all instances of Command::new with a new create_command function which will first resolve any executable paths and avoid this issue.
This creates a custom logger for the log crate which logs everything to a file (/tmp/starship/session_$STARSHIP_SESSION_KEY.log) and it logs everything above Warn to stderr, but only if the log file does not contain the line that should be logged resulting in an error or warning to be only logged at the first starship invocation after opening the shell.