1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-17 15:52:47 +00:00
Commit Graph

288 Commits

Author SHA1 Message Date
David Knaack
a499f30157
feat(rust): Configure when the module is shown (#2350)
This makes it possible to configure when the rust module is shown
based on the contents of a directory.
2021-02-21 18:01:17 +01:00
David Knaack
9ba82e8d92
feat(ruby): Configure when the module is shown (#2351)
This makes it possible to configure when the ruby module is shown
based on the contents of a directory.
2021-02-21 18:01:01 +01:00
Shu Kutsuzawa
c0a0e85556
feat(nodejs): Configure when the module is shown (#2348)
This makes it possible to configure when the nodejs module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.
2021-02-21 13:22:40 +01:00
Shu Kutsuzawa
4651060999
feat(nim): Configure when the module is shown (#2347)
This makes it possible to configure when the nim module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.
2021-02-21 13:21:20 +01:00
Thomas O'Donnell
873a005c42
feat(erlang): Configure when the module is shown (#2346)
* feat(erlang): Configure when the module is shown

This makes it possible to configure when the erlang module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.

* Update docs/config/README.md

Co-authored-by: Shu Kutsuzawa <cappyzawa@gmail.com>

Co-authored-by: Shu Kutsuzawa <cappyzawa@gmail.com>
2021-02-21 13:20:14 +01:00
Thomas O'Donnell
71b6fc1777
feat(elm): Configure when the module is shown (#2341)
This makes it possible to configure when the elm module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.
2021-02-20 18:33:00 +01:00
Thomas O'Donnell
9313e90773
feat(elixir): Configure when module is shown (#2340)
This makes it possible to configure when the elixir module is shown
based on the contents of a directory. This should make it possible to be
a lot more granular when configuring the module.
2021-02-20 18:32:04 +01:00
Mikołaj Rosowski
37d3425d21
feat: create shell module (#2329)
* Add the shell module

This module allows to quickly identify which shell is currently used, in case someone frequently switches between them.

* Updated documentation with shell module.

Co-authored-by: mro <mro@fedorabox.localdomain>
2021-02-20 15:40:49 +01:00
Thomas O'Donnell
d52edaa661
feat(dotnet): Configure when module is shown (#2327)
This makes it possible to configure when the dotnet module is shown
based on the contents of a directory. This should make it possible to be
a lot more granular when configuring the module.
2021-02-20 15:38:03 +01:00
Shu Kutsuzawa
5e93160456
feat(lua): Configure when the module is shown (#2326)
This makes it possible to configure when the lua module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.
2021-02-17 19:03:09 +01:00
Shu Kutsuzawa
97fbfffd7e
feat(golang): Configure when the module is shown (#2325)
This makes it possible to configure when the golang module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.
2021-02-17 18:58:21 +01:00
Shu Kutsuzawa
82c7fd6742
feat(terraform): Configure when the module is shown (#2324)
This makes it possible to configure when the terraform module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.
2021-02-17 18:57:40 +01:00
Thomas O'Donnell
e8f463bb57
feat(docker_context): Configure when module is shown (#2315)
* feat(docker_context): Configure when module is shown

This makes it possible to configure when the docker_context module is
shown based on the contents of a directory. This should make it possible
to be a lot more granular when configuring the module.

* Update docs/config/README.md

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

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2021-02-16 20:05:43 +01:00
David Knaack
856610d53b
feat(vagrant): Configure when the module is shown (#2314)
* feat(vagrant): Configure when the module is shown

This makes it possible to configure when the vagrant module is shown based on the contents of a directory.

* fix documentation

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

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2021-02-15 20:21:21 +01:00
Thomas O'Donnell
d0951db35a
feat(dart): Configure when the module is shown (#2312)
* feat(dart): Configure when the module is shown

This makes it possible to configure when the dart module is shown based
on the contents of a directory. This should make it possible to be a lot
more granular when configuring the module.

* docs(dart): add missing detected files

* removed invalid comment
2021-02-14 22:21:52 +01:00
David Knaack
d4843545aa
feat(zig): Configure when the module is shown (#2311)
* feat(zig): Configure when the module is shown

* remove outdated comment
2021-02-14 22:21:44 +01:00
Thomas O'Donnell
81d6f6aa98
feat(crystal): Configure when the module is shown (#2310)
* feat(crystal): Configure when the module is shown

This makes it possible to configure when the crystal module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.

* Update docs/config/README.md

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

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2021-02-14 18:14:55 +01:00
Thomas O'Donnell
47a769cdf8
feat(cmake): Configure when the module is shown (#2280)
This makes it possible to configure when the cmake module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.
2021-02-13 11:38:47 +01:00
David Knaack
eccbda8328
feat: allow changing default command timeout (#2283)
* feat: allow changing default command timeout

* fix clippy

* add doc to exec_cmd in Context

* update docs in CONTRIBUTING.md

* Fix comment in CONTRIBUTING.md

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

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2021-02-11 21:34:47 +01:00
Benjamin Fox
20d845f9b3
refactor(directory): Introduce logical-path argument which allows a shell to explicitly specify both a logical and physical filesystem path (#2104)
* refactor(directory): Introduce `logical-path` argument which allows a shell to explicitly specify both a logical and physical filesystem path

Fix `directory::module` to consume both path and logical-path (if provided).  The "logical" path is preferred when rendering the "display path", while the "physical" path is used to resolve the "read only" flag. Repo- and home-directory contraction behavior is maintained, based on the logical path if it is set, or the physical path if it is not.

The custom "get_current_dir" logic has been removed entirely, and the `directory` module now relies on `context.current_dir` / `context.logical_dir` entirely.

Changes have been made to `init/starship.ps1` to work with this new flag:
- Calculate and pass "physical" and "logical" paths explicitly (as other shells do not pass `--logical-path` that they fall back to rendering the physical path)
- Moved the "powershell provider prefix" cleanup code to the PowerShell script - this code _should_ now support any kind of powershell path prefix.

* fix(powershell): Fix an issue with trailing backslashes on file paths causing command line parsing issues.

This is a bit of a footgun!
The work-around chosen is to append a trailing space when a path string ends with a backslash, and then trim any extra whitespace away in the Context constructor.
Other alternatives considered and rejected:
1. Always trim trailing backslashes as the filesystem generally doesn't need them.
2. Escape trailing backslashes with another backslash. This proved complex as PS only quotes string args when the string includes some whitespace, and other backslashes within the string apparently don't need to be escaped.

* fix(powershell): Use Invoke-Native pattern for safely invoking native executables with strings which may contain characters which need to be escaped carefully.

* fix(context): Remove superfluous argument trims

These were in place to clean up extra whitespace sometimes injected by starship.ps1::prompt, and are no longer required with the new Invoke-Native helper in place.

* refactor(directory): Clean up the semantics of `logical_dir` defaulting it to `current_dir` but overridable by the `--logical-dir` flag.

- Restore `use_logical_path` config flag.
- Always attempt to contract repo paths from the `current_dir`.

* fix(directory) :Use logical_dir for contracting the home directory

This keeps the two calls to contract_path in sync.

* fix(directory): Remove test script

* refactor(directory): Convert current_dir to canonical filesystem path when use_logical_path = false

- This requires some clean-up to remove the extended-path prefix on Windows
- The configured logical_dir is ignored entirely in this mode - we calculate a new logical_dir by cleaning up the physical_dir path for display.
- Test coverage

* fix(directory): Use AsRef style for passing Path arguments

* fix(directory): Strip the windows extended-path prefix from the display string later in the render process

* fix(docs): Update docs/config/README.md for use_logical_path

* refactor(context): Populate `current_dir` from `--path` or `std::env::current_dir`, populate `logical_dir` from `--logical-path` or the `PWD` env var

- `current_dir` is always canonicalized
- On Windows, `current_dir` will have an extended-path prefix
- `logical_dir` is now always set
- `directory::module` now just selects between `current_dir` and `logical_dir` when picking which path to render
- Test coverage

* fix(directory): Fix path comparison operations in directory to ignore differences between path prefixes

- Added PathExt extension trait which adds `normalised_equals`, `normalised_starts_with` and `without_prefix`

* fix(path): Add test coverage for PathExt on *nix

* fix(directory): Test coverage for `contract_repo_path`, `contract_path` with variations of verbatim and non-verbatim paths

* fix(directory): Update path-slash to latest

This fixes the issue with the trailing character of some Windows paths being truncated, e.g. `\\server\share` and `C:`

* fix(powershell): Improve UTF8 output handling, argument encoding

- Use `ProcessStartInfo` to launch native executable, replacing manual UTF8 output encoding handling
- If we detect we're on PWSH6+ use the new `System.Diagnostics.ProcessStartInfo.ArgumentList` parameter, otherwise manually escape the argument string
- Move `Get-Cwd` and `Invoke-Native` into the prompt function scope so that they don't leak into the user's shell scope

* fix(path): Make PathExt methods no-ops on *nix

* fix(path): Cargo fmt

* fix(powershell): Remove typo ';'. Fix variable assignment lint.
2021-02-08 15:14:59 +01:00
Thomas O'Donnell
da4bd401c4
feat(python): Configure when the module is shown (#2264)
This makes it possible to configure when the python module is shown
based on the contents of a directory. This should make it possible to
be a lot more granular when configuring the module.

This includes a breaking change since we are removing the
`scan_for_pyfiles` configuration option in favour of setting the
`detect_extensions` to an empty array.
2021-02-07 22:18:52 +01:00
Furkan Türkal
9e21e3cf5f
feat(vagrant): Add support for Vagrant (#1812)
Signed-off-by: Dentrax <furkan.turkal@hotmail.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2021-01-30 12:05:16 +01:00
Rodrigo Suárez
ca36d15acd
feat(directory): Add home directory symbol (#2198)
* feat(directory): Add home directory symbol

* Replace HOME_SYMBOL constant as a config variable
2021-01-24 22:50:37 +01:00
Moritz Vetter
4e7f73da50
perf(zig): Lazy eval zig (#2187)
* perf(zig): evaluate version lazily

* fix(zig): update format string; update tests

* refact(zig): remove redundant clone and put everything to do with version eval into match statement

* tiny optimization

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

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2021-01-22 18:08:36 +01:00
Moritz Vetter
212dbc4e6b
perf(ocaml): evaluate version lazily; adjust format string; update test (#2188)
Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-22 18:08:04 +01:00
Moritz Vetter
16b8cbfdb8
perf(perl): Lazy eval perl (#2189)
* perf(perl): evaluate version lazily

* fix(perl): update format string; update tests

* refact(perl): run rustfmt

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-22 18:07:03 +01:00
Moritz Vetter
d10a83ce6b
perf(php): Lazy eval php (#2190)
* perf(php): evaluate version lazily

* fix(php): update format string; update tests

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-22 18:03:18 +01:00
Moritz Vetter
60be1e9540
Perf(purescript): Lazy eval purescript (#2191)
* perf(purescript): evaluate version lazily

* fix(purescript): update format string; update tests

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-22 18:01:54 +01:00
Moritz Vetter
00afc82049
perf(kotlin): Lazy eval kotlin (#2186)
* perf(kotlin): evaluate version lazily

* fix(kotlin): update format string; update tests

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-21 23:01:30 +01:00
Moritz Vetter
98b89b9432
perf(lua): Lazy eval lua (#2185)
* perf(lua): evaluate version lazily

* fix(lua): update format string

* test(lua): update tests

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-21 23:00:12 +01:00
Moritz Vetter
b5fd517972
perf(nodejs): evaluate nodejs format string lazily (#2160)
* fix(nodejs): update format string

* test(nodejs): adjust tests to new format strings

* fix(nodejs): use once_cell's Lazy to implement hassleless lazy execution

* chore(nodejs): run rustfmt

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-20 19:03:48 +01:00
David Knaack
8302a3ccb4
perf(custom): evaluate command lazily (#2173) 2021-01-20 19:01:49 +01:00
David Knaack
bb160d9207
perf(elixir): evaluate version lazily (#2172) 2021-01-20 18:59:21 +01:00
Moritz Vetter
2532251a13
perf(dart): Lazy eval dart (#2166)
* perf(dart): evaluate version lazily

* fix(dart): update format string

* fix: use suggested format string

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-20 18:56:18 +01:00
Moritz Vetter
83e0432a75
perf(java): Lazy eval java (#2168)
* perf(java): evaluate version lazily

* fix(java): update format string

* fix: use suggested format string

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-20 18:51:30 +01:00
Moritz Vetter
b065758b1c
perf(elm): Lazy eval elm (#2167)
* perf(elm): evaluate version lazily

* fix(elm): update format string

* fix: use suggested format string

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-20 18:49:26 +01:00
Moritz Vetter
527ffbaede
fix: Adjust default format strings (#2165)
* fix(dotnet): update dotnet format string

* fix(dotnet): update erlang format string

* fix(dotnet): update golang format string

* fix(dotnet): update helm format string

* fix(dotnet): update julia format string

* fix(dotnet): update nim format string

* fix(dotnet): update ruby format string

* fix(dotnet): update rust format string

* test: update formatted strings in unit tests

* Use suggested format strings

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

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2021-01-20 18:46:26 +01:00
Moritz Vetter
e437a463ac
perf(python): Lazy eval of python version command (#2158)
* perf(python): evaluate version lazily

* fix(python): update format string

* fix: use suggested format strings

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

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2021-01-20 18:42:55 +01:00
Moritz Vetter
2391a2863c
perf: evaluate swift version lazily (#2159)
* perf(swift): evaluate version lazily

* fix(swift): update format string

Co-authored-by: Moritz Vetter <mv@3yourmind.com>
2021-01-18 22:42:28 -06:00
Thomas O'Donnell
12494da38a
fix(cmake): Fix spacing with missing variable (#2135)
This fixes the additional space when the `version` variable can't be
populated.
2021-01-16 13:27:02 +01:00
Thomas O'Donnell
f640db87a4
perf(crystal): Lazily evaluate version command (#2129)
* perf(crystal): Lazily evaluate version command

This updates the module to lazily execute the `crystal --version`
command only when the `version` variable is used in the format string.

* perf(crystal): Update format string

Update format string to handle the `$version` variable not being set.
2021-01-13 18:35:44 +01:00
Kevin Song
3fc9f490bb
docs: Comment about spaces in nix-shell config (#2106)
* Add comment about doublespace in nix-shell config

* docs: Add a semantic PR commit to appease the bot
2021-01-09 10:29:47 +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
David Knaack
6de4bb01f4
feat(battery): make module behaviour more obvious (#1950) 2021-01-01 12:16:55 +01:00
Nicola Corti
208251adef
feat(kotlin): Add the kotlin module (#2026)
Add a module to show the currently installed Kotlin version if a
.kt/.kts file is found in the current folder
2020-12-26 15:26:50 +01:00
Daniel Beckwith
1296632ff4
feat(shlvl): Add repeat option (#1995) 2020-12-14 15:40:21 -05:00
quentm74
2e763b5e7c
feat: Move cmd_duration after custom module (#1681) 2020-12-05 19:57:22 +01:00
t-mangoe
89588a7391
feat(nodejs): check node engines version in package.json (#1847)
* check node engines version in package.json

* fix code, following review.
2020-12-05 12:25:48 +01:00
Thomas O'Donnell
cf8a6d0738
feat(python): Smarter python binary usage (#1947)
Update the python module to try multiple python binaries when
determining the version. With the new logic if starship doesn't find
`python` on the `PATH`, which is the default for some Linux Distros, it
will fallback to `python3` and then `python2`.
2020-11-30 13:14:18 -06:00
Sagittarius-a
688f1b3457
feat(git_branch): add remote branch name if different than local branch (#1915)
* feat(git_branch): add remote branch name if different than local branch

* feat(git_branch): Implement a more customizable remote branch

* feat(git_branch): Use more explicit API function name

* feat(git_branch): Remove forgotten draft documentation

* feat(git_branch): Set less verbose defaults

* feat(git_branch): Handle case to always display remote

* feat(git_branch): Fix error in rebase operation
2020-11-23 22:07:16 +01:00
Aaron Gable
4b85b40cb0
feat(git_branch): add 'only_attached' config bool (#1910)
* feat(git_branch): add 'only_attached' config bool

This adds a new boolean, `only_attached`, to the configuration for
the `git_branch` module. This mirrors the `only_detached` config
value for the `git_commit` module: setting the value to true causes
the module to suppress its output when the user is not on a branch.

This allows users to have either a branch name or a commit hash in
their prompt, as opposed to having either a branch name or the
overly-wordy "HEAD (sha1)".

* Fix formatting
2020-11-23 19:22:51 +01:00
Shu Kutsuzawa
c6d25a6a38
feat(lua): Add a Lua module (#1815)
* feat: add lua module

* docs: add lua module

* fix: lua version test

* feat: lua module can be detected if the current dir contains a "lua" dir

* feat: enable to use luajit

* fix: improve regex

* fix based on https://github.com/starship/starship/pull/1815#discussion_r510932742

* fix based on https://github.com/starship/starship/pull/1815#discussion_r511362581

* fix based on https://github.com/starship/starship/pull/1815#discussion_r510941252
2020-10-27 19:05:20 +01:00
Mauricio Teixeira
eec961caaf
feat(openstack): Add module for OpenStack (#1664)
* first (crude) attempt to implement the openstack module

* Attempt to follow OpenStack standards for clouds.yaml location

* fmt

* provide unittest

* add documentation

* fix fmt

* fix clippy

* fix clippy

* fix fmt

* fix small nitpicks

* expand openstack explanation

* load config file using find_map

* fix fmt

* add test for valid config, plus fix test for invalid config

* fix fmt

* re-add forgotten comment
2020-10-24 11:46:43 +02:00
Miguel Ángel Melón Pérez
ea9f803018
feat(git_commit): add git tag to module (#950) 2020-10-23 11:49:19 -04:00
Matan Kushner
783eb3373d
fix: replace emoji for cmake and erlang (#1787) 2020-10-13 18:01:35 -04:00
David Knaack
4de9e43cff
fix(directory): preserve substitution order (#1782) 2020-10-13 15:06:41 -04:00
Jeremy Hilliker
1673d565f4
feat(directory): add ellipsis to truncated paths (#1563)
Adds ellipsis in front of truncated paths: …/
Configurable through new config option: directory.truncation_symbol
Fixes #1162, #1626
2020-10-03 11:25:21 -05:00
David Knaack
b633248606
fix(readonly): change module to match docs (#1728) 2020-10-02 13:10:46 -04:00
Tilmann Meyer
2233683410
feat: add error messaging (#1576)
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.
2020-09-28 16:38:50 -04: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
Tilmann Meyer
a245d54cdb
fix(git-state): Fix discrepancy between v0.44.0 and master (#1672) 2020-09-21 15:17:06 -04:00
Thomas O'Donnell
bb324834a5
fix: restore the pyenv_prefix option to python (#1668)
Have restored the `pyenv_prefix` option to the python module. This is
added as a new variable that will only be shown if `pyenv` is being used
to determine the version of python that is being used.
2020-09-21 11:48:26 -04:00
Matan Kushner
d3100c5c82
fix: use suffixes for modules before directory (#1645)
Previously, all modules would have prefixes, which lead to the first
module having a dangling prefix. This change ensures that the first
few modules would instead have suffixes so that we don't start or
end with a prefix or suffix.
2020-09-08 12:09:21 -04:00
Matan Kushner
09672eeea7
fix: re-add add_newline to root config (#1598) 2020-08-18 18:58:29 +02:00
Matan Kushner
1cd4f12bb4
Revert "fix: restore add_newline configuration (#1592)" (#1596) 2020-08-17 12:30:01 -04:00
Matan Kushner
1652c0bdb1
fix: restore add_newline configuration (#1592) 2020-08-16 23:33:40 -04:00
Marc Schreiber
8c71eb5307
feat: Add Undistract Me Feature (#1019)
Often it is handy to get notified when the execution of a command finished.
This commit includes notify-rust in order to generate a desktop notification
when a command execution finished.
2020-08-11 18:44:25 +02:00
Daniel A. White
0be9ffc0a1
feat(shlvl): Add shlvl module (#1385)
* initial commit of support for shlvl

* documentation for shlvl

* use a symbol instead

* test coverage for shlvl

* actually disable when the config says to

* fix docs

* tweak defaults some

* refactor from pr comments

* redisable

* return early to avoid indenting

* make default suffix empty space

* fixing tests after suffix change

* updating docs for format

* making shlvl compatible with formatting

* adding variables table for shlvl

* removing extra line

* doc clarity
2020-08-05 18:30:01 +02:00
Stéphane Benoit
ef55042f2e
feat(perl): Added perl version module (#1382)
Adds a module for perl support.
2020-08-04 11:22:44 -05:00
Takahiro Tsuruda
c5f2eedf07
feat: Add gcloud module (#1493)
* feat(gcloud): Add document of gcloud module

Signed-off-by: dulltz <isrgnoe@gmail.com>

* feat(gcloud): Add gcloud module

Signed-off-by: dulltz <isrgnoe@gmail.com>

* feat(gcloud): Add test for gcloud module

Signed-off-by: dulltz <isrgnoe@gmail.com>

* Apply the comment

https://github.com/starship/starship/pull/1493\#discussion_r456965413
Signed-off-by: dulltz <isrgnoe@gmail.com>
2020-08-03 23:30:20 +02:00
Jason Wang
acefbc523f
feat(conda): add ignore_base option (#1539)
* Add ignore_base to conda module

* Add ignore_base to conda module in English docs

* `ignore_base` defaults to `true`
2020-07-30 18:57:15 +02:00
Dario Vladović
84f049f836
feat(dart): add Dart module (#1392) 2020-07-29 11:38:23 -04:00
Dario Vladović
feb4124cac
feat(swift): add Swift module (#1261) 2020-07-29 11:36:49 -04:00
David Knaack
869a6f3140
fix: fix compilation with battery feature disabled (#1509) 2020-07-24 17:42:36 -04:00
Batuhan Apaydın
03d75eb419
feat(helm): Add Helm module (#1463)
Signed-off-by: Furkan <furkan.turkal@hotmail.com>

Co-authored-by: Furkan <furkan.turkal@hotmail.com>
2020-07-17 09:51:25 +02:00
Alexey Chernyshov
57c39437bc
feat(directory): Show lock symbol if current directory is read only (#1298)
Add feature to display icon if current directory is read-only.
2020-07-13 16:55:42 -05:00
Tilmann Meyer
bd68970fab
feat(cmake): Add CMake module (#1456)
* feat: CMake module

* docs: Document symbol variable
2020-07-09 21:40:33 +02:00
Zhenhui Xie
ec76fafff0
feat: refactor modules to use format strings (#1374) 2020-07-07 18:45:32 -04:00
Matan Kushner
428a78ebb5
fix!: remove haskell module (#1418)
Given how slow the Haskell module is (#1240), it is slowing down the entire prompt
from rendering when the module is active. This commit removes the module until we
can find a faster way to retreive the Haskell version.
2020-07-06 13:00:52 -04:00
Thomas O'Donnell
055986e2b1
feat(python): Add option to change the python binary (#1297)
* Add option to change the python binary

We are going to start to have problems with the python binary as python2
is removed and replaced with python3. To make the transition easier I
have added an option to the python module to allow the user to pick a
particular binary, e.g `python3`, for the module to use when selecting
the version of python. I have also refactored the python tests moving
almost all of them into the module and removing the dependency on the
version of python that is installed on the system.

* Add advanced config section to python module docs

Have added an advanced config section to the python module docs and
moved the `python_binary` option into that section.
2020-06-14 11:27:10 +02:00
Rekihyt
fcd003785b
feat(nim): Add Nim module (#1189)
* Nim module and tests

* Add nim to docs

* parse_nim_version refactor, add nim desc

* Add nim symbol to Nerd Font preset

* Yellow with v prefix as default version

* Nim version fmt fix

* Update docs/config/README.md

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Update src/modules/nim.rs

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Nim module and tests

* Add nim to docs

* Yellow with v prefix as default version

* Update docs/config/README.md

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Update src/modules/nim.rs

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Add nim to docs, proper version formatting.

* Remove v from symbol, add to fmt string

* cargo fmt

Co-authored-by: Dario Vladovic <d.vladimyr@gmail.com>
2020-06-09 19:14:47 +02:00
Samuele Esposito
fe2b3d491e
feat(time): Show module with time range (#992)
* Creation of range field in TimeConfig

* time_range parsing

* Hide time module if outside of time_range

* Tidying of code, and properly handling more cases

* is_inside_time_range function

* Tests and fmt

* Update docs

* The configuration needs the 24-hours format

* Fix clippy errors
2020-05-31 19:43:08 +02:00
Radu Butoi
ab1c3d1c54
feat(directory): Add directory substitutions (#1183)
Adds an option to provide a table of strings to substitute in the
directory string. Fixes #1065.

Co-authored-by: Radu Butoi <butoi@google.com>
2020-05-31 19:32:35 +02:00
Grégoire Geis
09996159f4
fix(custom): improve handling of Powershell prompts (#1237)
To improve overall support of PowerShell in custom modules,
the ability to pass arguments to the shell was also added. Additionally,
the arguments `-NoProfile -Command -` will be automatically passed
to PowerShell, unless other arguments are given by the user.
2020-05-27 09:38:05 +02:00
nobv
63799b97d1
feat(PureScript): Add Purescript module (#1227)
* Added configs/purescript

* Added modules/purescript

* Added necessary codes

* Added tests

* Updated README

* Fixed color because black is hard to see

* Fixed of push mistake

* Fixed pointed out in PR
2020-05-22 18:26:58 +02:00
Dario Vladović
c008f4041b
feat: add Zig module (#1231) 2020-05-21 18:49:49 +02:00
Hirochika Matsumoto
9e8f35d746
feat(ocaml): Add OCaml module (#1218)
* Add OCaml module

* Update README.md accordingly

* Fix typo

* Add Reason support

Obtain OCaml version using `-vnum` flag.
Extend conditions to match projects using jbuild, esy
or merlin.

* Update README.md

Co-authored-by: Dario Vladovic <d.vladimyr@gmail.com>
2020-05-21 18:43:13 +02:00
Karol Fuksiewicz
eba4d87612
feat(package): configurable displaying package version for packages marked as private (#1109)
* feat(package): config for enabling package version in private packages

* test(package): refactor package tests
2020-04-28 10:53:30 +02:00
Benedikt Reinartz
8c17f7b97c
feat(erlang): Add Erlang module (#1129) 2020-04-27 12:09:42 +02:00
Alexandru Macovei
2c30f4bd9e
fix(crystal): Add Crystal module to default prompt order (#1140) 2020-04-24 19:37:34 +02:00
Alex Jurkiewicz
965338df95
feat(python): Add scan_for_pyfiles option (#692)
Also adds two new entries to the list of hardcoded files to check:
setup.py and __init__.py.
2020-04-14 10:26:51 +02:00
Grégoire Geis
15dc486e72
Add support for custom modules. (#916) 2020-04-11 18:37:24 +02:00
Bernardo Meurer
7718450311
feat(nix_shell): add symbol to nix-shell module (#1058)
* feat: add nix-shell icon

Fixes #1048

* style: make nix-shell bold blue by default

It better matches the whole theme around Nix and snowflakes.
2020-04-07 18:35:18 +02:00
Shu Kutsuzawa
2f449af680
Fix julia icon based on https://julialang.org/community/standards/ (#1055)
According by this standards
> While "Julia" is a female name in many parts of the world, the programming language is not a person and does not have a gender.
2020-04-07 11:07:51 +02:00
Barnaby Keene
b685bb2954
feat: add docker context module (#996)
* feat: add docker context module

Adds a simple module that checks for a Docker config file and if present, reads the `currentContext` value out and displays on the prompt with a whale.

* feat: add `only_with_compose_yml` option to docker_context

When enabled, will only show the docker context name if there's a docker-compose.yml file in the current directory.

* Update src/modules/docker_context.rs

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

* Update src/modules/docker_context.rs

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

* rename `only_with_compose_yml` configuration key to a more generic `only_with_files`

* Update src/modules/docker_context.rs

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

* re-order configuration table

* Update docs/config/README.md

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

* Update src/configs/docker_context.rs

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

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-04-05 21:42:55 +02:00
sk1985
e38be5073f
feat(kubernetes): context aliases (#1015)
* Allow kubernetes module to use aliases for contexts

* documentation for kubernetes context aliasing

* Apply suggestions from code review: consistent ordering of options in documentation

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

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-04-03 20:18:44 +02:00
Shu Kutsuzawa
dba3467dee
feat: Add a julia module (#1030)
* add a julia module

* Update docs/config/README.md

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

* fix based on https://github.com/starship/starship/pull/1030#pullrequestreview-381767326

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-04-03 20:16:34 +02:00
KokaKiwi
243e97cfe6
feat: add Elixir module (#437) 2020-03-01 22:29:27 -05:00
Tadej Novak
7e66791cb2
feat: add singularity module (#932) 2020-02-26 11:18:19 -05:00
nesmyslny
0312c7b91e
feat(git_commit): Show the hash of commits when detached HEAD (#738) 2020-02-12 14:56:29 -05:00
Andrew Prokhorenkov
273a937505 feat: Add an Elm module (#879)
Former-commit-id: d42137309da457a438b554601f0734db963a193e
2020-02-05 22:57:04 -05:00
Youssef Habri
f665df226c
feat: Add Crystal version module (#170) 2020-02-04 18:27:06 -05:00
Matan Kushner
11b737bb44
feat!: Update colors of package and php modules (#782) 2020-02-01 18:10:12 -05:00
Andrew Prokhorenkov
9229a48bc9
fix(haskell): Add the Haskell module to the default prompt order (#893) 2020-02-01 17:16:10 -05:00
Andrew Prokhorenkov
6f2c9fb397 feat: add Haskell Stack support (#546)
Add a Haskell Stack module when a stack.yaml file is detected
2020-01-25 00:48:39 -06:00
marblenix
b82ff321fa feat(git_status): Add a stash count segment (#598) 2019-12-28 22:20:36 -05:00
Mike Sampson
256a2be949 feat: Implement AWS region aliases (#646) 2019-12-20 12:30:47 -05:00
Luca Rinaldi
6a2b0a67b0 feat: cmd_duration module optionally reports milliseconds (#696) 2019-12-19 17:38:06 -05:00
AppleTheGolden
ea04f9bfc1 fix: Add php to the default prompt order (#708) 2019-12-10 11:52:55 -05:00
AppleTheGolden
3c835ba34b fix: Truncate long paths in conda environment names (#694)
Environment names created via conda create -p [path] tend to be too long for comfort, so this truncates them.
2019-12-09 12:59:02 -05:00
Matan Kushner
60a1319524
docs: Reorder terraform option rows for consistency 2019-12-08 20:43:36 -05:00
wdullaer
44b37a7bac feat: Implement terraform module with workspace and version (#644) 2019-12-08 20:42:51 -05:00
Dan Wendorf
dee25c7b35 feat: Add prefix config to directory module (#642) 2019-12-06 14:19:11 -05:00
Qingping Hou
c5a206e3cf feat: Add git_commit module (#673) 2019-12-06 11:57:42 -05:00
Stephen Ball
46904e5045 feat: Add PHP version module (#244) 2019-12-05 13:04:27 -05:00
Luca Greco
337f213753 feat: Add the hg_branch module (#569) 2019-12-02 17:37:18 -05:00
Matias Kotlik
135dddbb4f feat: Add separator config to the memory module (#603) 2019-11-13 10:57:46 +09:00
Zhenhui Xie
a3d5ea3e43 refactor: Refactor git state module to use module config (#605) 2019-11-06 22:00:31 +09:00
Zhenhui Xie
48726fdd2a refactor: Refactor nix_shell and java module to use module config (#606) 2019-11-06 21:59:12 +09:00
Cédric Da Fonseca
fa1267f12f feat: Add configuration to set how much AWS profile info is shown (#556) 2019-11-02 20:08:54 +09:00
Zhenhui Xie
fed1341e22 feat: Add an option to limit the duration of starship directory scanning (#589) 2019-10-28 22:41:16 +09:00
Brian Low
2710d02709 feat: Show git_status counts (#434)
The git_status module can show the count of files next to their respective symbols.
2019-10-26 15:20:20 +09:00
Zhenhui Xie
321e440289 chore: Move StarshipRootConfig to a separate file (#581) 2019-10-25 10:08:09 +09:00
Matias Kotlik
86bb923303 refactor: Refactor memory_usage module to use module config. (#515)
Also addresses a number of bugs:
- the percent sign not displaying correctly on some terminal emulators, including kitty
- changing the symbol in the configuration file didn't do anything
- swap being shown even if the system didn't have any
2019-10-21 00:26:04 +09:00
Zhenhui Xie
aadd8ecf2c refactor: Refactor modules to use module config (#514) 2019-10-19 10:51:38 +09:00
Matias Kotlik
d2eef11148 refactor: Refactor git_branch module to use new module config (#535) 2019-10-15 20:48:53 +09:00
Zhenhui Xie
be2d5cf1cd refactor: Rewrite cmd_duration, directory and env_var module to use module config (#460)
This PR is a batched rewrite of the following modules:
- cmd_duration
- directory
- env_var
2019-10-15 20:34:48 +09:00
Zach Mertes
5303fd7684 feat: Add configuration for hostname truncation (#485) 2019-10-15 01:22:25 +09:00
Thomas Lee
b3275d8ddf feat: Show AWS region in aws module (#482) 2019-10-15 00:05:03 +09:00
Thomas O'Donnell
a18408e30c fix: Fix the spacing around the AWS default symbol (#529)
This updates the default AWS default symbol to include a space after the
symbol to make it a little bit more readable. Have also updated the
README to include the AWS module.
2019-10-14 22:56:16 +09:00
Thomas O'Donnell
cc68dec795 refactor: Refactor Go module to the new module config (#525) 2019-10-13 13:16:56 +09:00
Zhenhui Xie
57b38f17bb refactor: Rewrite hostname, jobs and line_break module to use mo… (#462) 2019-10-10 17:21:52 +09:00
Keith Wade
9d48706360 feat: Implement timezone offset config option for the time module (#463)
This allows users to configure the time module to display time with a timezone offset other than just their local timezone.
2019-10-10 13:42:57 +09:00
Nikodem Rabuliński
06ba22eb5c refactor: Implement Default for SegmentConfig (#495)
Implements the Default trait for SegmentConfig to clean up construction of empty segments.

Also adds a segment::new() function to ease construction of simple segments.
2019-10-05 20:46:14 -05:00
AppleTheGolden
7657af0680 feat: Add conda module (#469) 2019-10-05 13:25:25 -05:00
Thomas Lee
27e8c8f3eb refactor: Rewrite time module to use module config (#483)
- Config option renamed: `12hr` → `use_12hr`
2019-10-06 00:07:00 +09:00
Thomas O'Donnell
5a8777ff45 fix: Disable Kubernetes module by default (#488)
Given the global nature of the Kubernetes module, the module has been disabled by default. The opportunity has also been taken to refactor the Kubernetes module to use the new config module.
2019-10-05 18:31:23 +09:00
Matan Kushner
05210b9510
refactor: Go from Rust workspaces to a package with nested packages (#480) 2019-10-04 22:30:46 +09:00