starship/src
Mick Hohmann 43b2d42cd5
feat(hostname): add detect_env_vars as option (#5196)
* Added hostname.detect_env_vars

based on the newly added context::detect_env_vars

- extended context::detect_env_vars to check for negated environment
  variables as well, analogous to the other detect modules
- made hostname.detect_env_vars only active if ssh_only is set to false
  for backwards compatibility

Co-authored-by: Dominik Sander <dsander@users.noreply.github.com>

* added clippy recommendations, removed unneeded comments

* Added new logic (suggested in https://github.com/starship/starship/pull/5196#issuecomment-1566228913)

The new `detect_env_vars` now requires either SSH_ONLY to be false or the
environment variable SSH_CONNECTION to be set, so that is will be used

* Fixed typo

* Refactored the detect_env_vars function for early returns and better readability

* Change boolean logic for better readability

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* Apply suggestions from code review to `detect_env_vars` method.

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* Fixed bracket error & updated comments

- fixed bracket error in hostname.rs, after changes
- updated comments for context.rs, for the suggested changes

* Removed obsolete warning from docs/config/README.md

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

---------

Co-authored-by: Dominik Sander <dsander@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2023-09-16 16:42:13 +02:00
..
configs feat(hostname): add detect_env_vars as option (#5196) 2023-09-16 16:42:13 +02:00
formatter chore: handle rust 1.72 clippy & fmt changes (#5399) 2023-08-25 22:53:35 +02:00
init perf: Skip unnecessary indirection in starship init zsh (#5322) 2023-08-31 19:08:13 +02:00
modules feat(hostname): add detect_env_vars as option (#5196) 2023-09-16 16:42:13 +02:00
test refactor(Context): `set_config` method for `Context` (#5079) 2023-04-24 16:03:47 +02:00
bug_report.rs chore: fix clippy warnings for rust 1.66 (#4715) 2022-12-17 18:01:27 +01:00
config.rs chore: handle rust 1.72 clippy & fmt changes (#5399) 2023-08-25 22:53:35 +02:00
configure.rs chore: fix new clippy lints (#5241) 2023-06-13 17:06:04 -05:00
context.rs feat(hostname): add detect_env_vars as option (#5196) 2023-09-16 16:42:13 +02:00
context_env.rs fix(config): Make print-config not panic without a config (#5001) 2023-04-13 19:29:21 -05:00
lib.rs fix(config): Make print-config not panic without a config (#5001) 2023-04-13 19:29:21 -05:00
logger.rs chore: handle rust 1.72 clippy & fmt changes (#5399) 2023-08-25 22:53:35 +02:00
main.rs fix(config): Make print-config not panic without a config (#5001) 2023-04-13 19:29:21 -05:00
module.rs feat(fossil_metrics): add fossil_metrics module (#4874) 2023-09-02 09:19:04 +02:00
print.rs fix(rprompt): remove lprompt modules from `$all` again (#5067) 2023-07-06 11:32:17 +02:00
segment.rs refactor: replace `ansi_term` with `nu_ansi_term` (#4339) 2022-09-04 18:44:54 +02:00
serde_utils.rs build(deps): update toml crates (#4853) 2023-01-30 23:12:27 +01:00
utils.rs feat(fossil_metrics): add fossil_metrics module (#4874) 2023-09-02 09:19:04 +02:00