1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2025-01-28 17:48:25 +00:00

1041 Commits

Author SHA1 Message Date
David Knaack
43f097eae8
fix(hostname): use DNS instead of NetBIOS name on Windows (#6343) 2025-01-11 15:00:48 +01:00
David Knaack
af5d139060
fix(username): avoid using whoami on android (#6342)
Closes #6340

Co-authored-by: AminurAlam <64137875+aminuralam@users.noreply.github.com>
2025-01-11 14:59:29 +01:00
David Knaack
dfddd999c3
chore: handle updates for os-info, windows and shadow-rs (#6487)
* build(deps): update rust crate windows to 0.59.0

* chore: handle windows update

* chore: handle os_info update

* build(deps): update rust crate shadow-rs to 0.37.0

* chore: handle shadow-rs update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-11 14:58:02 +01:00
David Knaack
b5e865ae7d
chore: fix clippy warnings for rust v1.83 & current nightly (#6413)
* chore: fix clippy warning for rust v1.83

* chore: fix clippy warning for nightly rust
2025-01-09 19:49:59 +01:00
Eduardo J. Ortega U.
6678c13c24
docs: fix typo in comment of git_commit module (#6472) 2025-01-09 19:42:59 +01:00
MK
2df521c69b
feat(bun): Detect bun using new text-format lockfile (#6441)
* Support bun text-format lockfile

Bun version 1.1.39 introduced a new plaintext lockfile. Currently it is opt-in only, but it will become the default in bun version 1.2.

* update docs

* update config schema

* update tests
2024-12-29 18:20:01 +01:00
Ky
2690a329cf
feat(battery): Use best match instead of first match for battery.display threshold (#6442)
Previously the selection code simply filtered for the first style found
within the config with a threshold larger than the current battery
percentage. If the config defined multiple display thresholds that were
above the battery percentage it would only select the first one that was
encountered rather than the one that was closest to the current battery
percentage.

This commit also adds a test to ensure this property is held true. The
test accomplishes this by comparing the parsing of a config with two
`battery.display` entries, one with a threshold at 100% & the other at
60%, with a mock battery set at 50% charge. This config is parsed with
the 100% threshold defined above the 60% threshold, and then again with
the 60% threshold defined above the 100% threshold. To ensure the
entries are parsed parsed correctly each entry is given a different
style, so the expected value that is compared against has the same style
as the 60% threshold entry for both test cases.


* Update src/modules/battery.rs

Use more concise chain of functions from Iterator

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

---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2024-12-27 11:32:13 +01:00
T0mstone
e21775c694
feat(status): add {success,failure}_style options (#6269) 2024-12-27 11:30:28 +01:00
Nick Conway
45937166c8
feat(direnv): allow direnv to detect environment variables (#6196) 2024-12-27 11:25:15 +01:00
Rich Lafferty
7ead2b55eb
fix: handle variable bash $SHLVL behavior with explicit option (#4912)
* Accept shlvl as --shlvl option

* For bash only, pass --shlvl explicitly

* fmt

* Apply suggestion

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

* Apply suggestion

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

* parse_jobs -> parse_i64

---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2024-12-27 11:14:10 +01:00
Gilbert Sanchez
9b6d394e01
fix(init/pwsh): preserve ViModeChangeHandler (#6225)
* Combine ViModeChangeHandler

If a user has defined a ViModeChangeHandler setting this would respect that as well as redraw the prompt (to allow rendering things like the character change).

* Add newline

* Use call operator to limit new closure scope

* Pass any args to original handler
2024-12-27 11:11:45 +01:00
Poliorcetics
8a38b8f6f1
fix(status): add trailing space to pipestatus_format (#6404) 2024-11-24 19:13:35 +01:00
David Knaack
85d3fb2e2a
fix(fish): restore support for fish <v3.4.0 (#6337) 2024-11-15 09:46:42 +09:00
Balthild
576aa14d15
fix(init): do not use cygpath for elvish (#6376) 2024-11-09 14:08:36 +01:00
Chiffa
639c7c6285
test(username): Default to false for is_root_user() regardless of the OS (#6358)
Default to false for tests regardless of the OS

Checking for username along with cfg!(test) seems redundant, especially because of one edge case - root user can be renamed
2024-11-09 14:06:58 +01:00
David Knaack
00d927bb20 revert: "perf(fish): Skip unnecessary indirection in starship init fish" (#6326)
Revert "perf(fish): Skip unnecessary indirection in starship init fish (#6253)"

This reverts commit 798f64033f5348793003ddd74fa0ce1c744c300b.
2024-10-18 18:22:53 +02:00
David Knaack
a5631a17dd
refactor: bump msrv to remove once-cell, improve logger test & handle clippy warnings (#6315)
* refactor: replace `once_cell`-crate with stdlib

* test(logger): make log cleanup-test cross-platform

* chore: handle clippy warnings

* build(deps): update dependency dprint/dprint-plugin-toml to v0.6.3

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-17 16:03:22 +02:00
Daniel Waltz
22c6c5201d
feat(deno): add deno.lock file to default detect_files list (#6310)
* feat(deno): add `deno.lock` file to default `detect_files` list

* feat(deno): add `deno.lock` to default detect files in schema

* test: add test for `deno.lock` file presense

* docs: add `deno.lock` to list of default files

* chore: formatting

* Revert "docs: add `deno.lock` to list of default files"

This reverts commit 6d0dc577d5bf5d04f1b4f00b4be0f3a398b30c5d.

* docs: add `deno.lock` to default detect files in primary readme

* chore: revert formatting from latest version of dprint

* docs: add `deno.lock` to default detect files list and format
2024-10-14 22:05:23 +02:00
Ben Fritsch
14babde435
fix(docker_context): Ignore Docker Desktop "desktop-linux" context. (#6314)
* Docker Desktop uses "desktop-linux" instead of "default" as the default context since version 3.5.
This filters "desktop-linux" in the same way as "default".
https://github.com/starship/starship/issues/6170

* update docs/config/README.md
2024-10-14 22:02:52 +02:00
David Knaack
77f08832d5
fix: use whoami for user/hostname queries again (#6311) 2024-10-14 20:46:04 +02:00
Kevin Boshold
d6814be0ba
fix(fish): add missing arguments for fish transient prompt functions (#6181)
Fixes #6180
2024-10-13 22:21:31 +02:00
David Knaack
25f356e3b5
chore: fix minor ci failures (#6293)
* chore: add trailing newline to config schema

* chore: fix typo

closes #6291
2024-10-07 21:18:44 +02:00
David Knaack
8419c677f1
chore: fix hindi truncation tests and bump deps (#6271)
* chore: fix hindi trunc test

* chore: bump deps
2024-09-28 13:41:35 +02:00
Baku Kim
36134d896b
feat(python): detect pixi and ipynb files (#6228) 2024-09-26 10:53:18 +02:00
Kid
244c2c629e
fix(fish): use correct input function in transient execute (#6265) 2024-09-26 10:50:33 +02:00
Kid
798f64033f
perf(fish): Skip unnecessary indirection in starship init fish (#6253)
perf: Skip unnecessary indirection in starship init fish
2024-09-17 22:54:13 +02:00
Thorsten Hans
b0669daf6d
chore: fix typo in comment to make spell-check pass (#6239)
Signed-off-by: Thorsten Hans <thorsten.hans@fermyon.com>
2024-09-06 21:30:56 +02:00
Daniel Kneipp
171746a584
feat(mojo): add module for Mojo language (#6108)
* feat: add support to mojo lang

* docs: fix mojo formatting

* Update src/modules/mojo.rs

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

* feat(mojo): parse hash as an independent variable

* chore(mojo): fix formatting

* chore(mojo): update schema and docs

* feat(mojo): use lazy cmd evaluation

---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2024-08-18 18:12:39 +02:00
Thomas O'Donnell
8a2d944bc8
feat(python): Add detect env vars option (#4486)
feat(python): Configure different detect env vars

Allow the env vars that trigger the python module to be configured, if
an empty list is passed then the module will fall back to just
triggering based on the configured files, folders and extensions.
2024-08-18 18:11:13 +02:00
James Thorne
33b3b8e398
fix(git_status): read proper name for core.fsmonitor flag (#6173) 2024-08-18 17:19:26 +02:00
Eduard Korchmar
68a8fc9563
feat(hostname): add option to replace hostnames with aliases (#6097)
---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2024-08-12 18:26:35 +02:00
苏向夜
7b65ad5163
fix(python): improve parsing of pyvenv.cfg files (#6145) 2024-08-12 18:25:04 +02:00
Leon Strauss
4abea6b601
fix(cmd_duration): Make render_time format more consistent (#5825)
* fix(cmd_duration): Make render_time format consistent

* Cleanup render_time comments

* Fix AWS test for new render_time format
2024-07-29 22:22:55 +02:00
JKatzwinkel
a62012e328
fix(package): support alternative gradle module version syntax (#6080)
feat(package): support alternative gradle module version syntax (#6079)
2024-07-29 22:19:56 +02:00
Stone
274dff37db
fix(fish): improve fish transient prompt (#6107)
* feat(fish): improve fish transient prompt

* feat(fish): improve fish transient prompt
2024-07-29 21:59:17 +02:00
Koichi Murase
e1189ed756
fix(bash): fix variable leak in Bash integration (#6143)
* fix(bash): quote array expansions to work around custom IFS

* fix(bash): locally set standard IFS for $(jobs -p)

* fix(bash): localize the leaked variable "job"
2024-07-29 21:43:41 +02:00
David Knaack
cfc58161e0
Merge commit from fork
addresses GHSA-vx24-x4mv-vwr5
2024-07-26 19:31:41 +02:00
David Knaack
d0cfa1756c
chore: cargo fmt (#6124) 2024-07-26 08:42:45 +02:00
David Knaack
6806f56c90
chore: bump deps and address clippy warnings (#6116) 2024-07-25 22:17:06 +02:00
larswirzenius
6000231d12
chore: Minor changes to use more idiomatic Rust (integer max values; complicates nested expressions) (#6090)
* chore: use current way to get max value of an integer type

The std::usize::MAX way has been obsolete for quite some time now.
Found by clippy (clippy::legacy_numeric_constants).

Signed-off-by: Lars Wirzenius <liw@liw.fi>

* chore: use helper variable for a more idiomatic pattern matching

A nested expression can be harder to understand than two simpler
expressions. (Found by clippy lint clippy::blocks_in_conditions.)

Signed-off-by: Lars Wirzenius <liw@liw.fi>

---------

Signed-off-by: Lars Wirzenius <liw@liw.fi>
Co-authored-by: Lars Wirzenius <liw@liw.fi>
2024-07-24 21:06:40 +02:00
Alvaro Aleman
fae92b2964
perf(k8s): Improve performance of kubeconfig module (#6032)
* Fix config schema

* Improve performance of kubeconfig module

This module currently takes about 200 ms when using our ~10MiB
kubeconfig. This change improves its performance by:
* Only parsing the file once
* (Naively) checking if the content is yaml or json and potentially
  parse as the latter, as that seems to be much faster
2024-07-16 22:26:03 +02:00
David Knaack
52a89a515e
fix(dotnet): Remove duplicate v in dotnet version (#6060)
* Remove duplicate `v` in dotnet version

Every language version provider returns the version without a leading 'v', and the shared code then prepends the 'v'. Take a look at Python for example.

The Dotnet provider prepends a 'v' however, causing the version to be printed like 'vv8.0.203'.

* Update src/modules/dotnet.rs

* tests(dotnet): add test for obtaining version from cli

---------

Co-authored-by: Bernd Verst <github@bernd.dev>
2024-07-07 16:15:56 +02:00
Iuliia Gracheva
4d36d463b9
feat(gcloud): Disabled gcloud module when active config hasn't been set (#6039)
* disabled gcloud module when active config hasn't been set

* added test case

* updated config-schema
2024-06-29 23:00:07 +02:00
Jovan Gerodetti
9a3e87f2cb
feat(color): add prev_fg and prev_bg as color specifiers based on the previous foreground/background colors respectively (#6017)
feat(color): add prevfg,prevbg as color specifiers based on the previous foreground/background colors respectively

Co-authored-by: Vladimir Lushnikov <vladimir@solidninja.is>
2024-06-28 23:40:35 +02:00
Evan Mattiza
e0281868c9
feat(purescript): add support for spago-next configuration files (#6036)
* update: add purescript spago-next configuration files

in upcoming spago projects, the configuration file is changing from
spago.dhall -> spago.yaml and spago.lock. This will detect both styles
for the time being

* fix typo

did not update test. spago.yaml -> spago.lock in the spago lock file
test case
2024-06-28 23:39:40 +02:00
David Knaack
aa05a1e5ab
chore: fix rust 1.79 lint warnings (#6034)
* chore: fix rust 1.79 lint warnings

* chore: update config-schema
2024-06-22 09:52:46 +02:00
David Knaack
8c75822d43
fix(k8s): don't trigger if scan config is set but env vars are not (#5979) 2024-06-09 09:55:13 +02:00
DerRockWolf
478d5cccb6
fix(direnv): replace nonexistent "orange" color with "bright-yellow" (#5969)
* Fix direnv config: change style from nonexistent "bold orange" to "bold bright-yellow"

* generate config-schema.json

* fix tests
2024-06-02 15:24:12 +02:00
John Hooks
5facd85da5
feat(nats): Add NATS Context (#5900)
---------

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2024-05-15 18:46:14 +02:00
William Veal Phan
2221a88f5a
perf(scala): use scala-cli first to avoid timeout (#5952)
fix(scala): use scala-cli first to avoid timeout
2024-05-12 20:32:08 +02:00