1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-07-01 05:43:30 +00:00
Commit Graph

508 Commits

Author SHA1 Message Date
Jason Wang
14f7cd461c
fix(bash): init breaks if PROMPT_COMMAND includes starship_precmd as an intermediate command (#1541) 2020-08-03 22:05:31 +02:00
David Knaack
36ae36282a
refactor(directory/lock): fix clippy, replace str with Path (#1544) 2020-08-02 18:42:38 +02:00
Steve Smith
b14be4dfb1
feat(package): Add Maven pom.xml version support (#1511)
* Add gitignore for Emacs backup files.

* Add package version support for Maven pom.xml.

* Update docs with Maven package version support.

* Fix for clippy.
2020-07-31 09:54:03 +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
Alexey Chernyshov
fbaeef8589
Do not check readonly on network locations (#1506)
Do not try to analyze if the current process can write network location
on Windows. There's no way on Windows to tell if we can write a network
location because it's not being controlled by the OS itself. Thus now
the lock symbol is never shown on network locations.  

This PR introduces a new unsafe call.
2020-07-30 11:22:19 -05:00
Dario Vladović
997387ee50
refactor(java): parse version using regex (#1496)
* refactor(java): parse version using regex

Mock java version retrieval & extend java module test suite with
rendering tests.

* chore: remove nom crate

* fix(java): support parsing version from both stdout & stderr

* fix(java): fix java command mock

* refactor(java): simplify version regex
2020-07-29 18:26:46 +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
Simão Mata
1acce65462
feat(package): Add support for Helm charts (#1525)
Signed-off-by: Simão Mata <sm@0io.eu>
2020-07-29 14:06:47 +02:00
LOU Xun
3818f901d4
perf: only check timeout every 256 files (#1499) 2020-07-28 22:26:00 +02:00
David Knaack
869a6f3140
fix: fix compilation with battery feature disabled (#1509) 2020-07-24 17:42:36 -04:00
Dario Vladović
6763a7b006
test: fix mocked commands (#1491)
Ensure that output of mocked commands faithfully replicates output
of actual commands including any trailing whitespace.
2020-07-19 17:01:53 -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
Thomas O'Donnell
15bc9fa210
fix(ocaml): Stop new line being included in ocaml version (#1479)
This fixes a regression in the ocaml module that caused the excess whitespace
to not be trimmed from the version.
2020-07-15 23:22:40 +02:00
David Knaack
133574ab09
fix(config): don't panic when hex color is too short (#1473)
* fix(config): don't panic when hex color is too short

* check length instead of using get
2020-07-14 23:11:43 +02:00
Alexey Chernyshov
08b74c1672
fix(git_status): Fix file rename inconsistency compared to git (#1411)
* Remove renames_index_to_workdir() option from git status

This option causes advanced files rename detection which causes inconsistency between `git status` and Starship reports.
Closes #1371

* add test for manually remaned and deleted files in git_state module

* fix tests
2020-07-14 23:08:56 +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
Gerry
427f48aa8d
fix(nodejs): remove line break from version (#1464)
A recent refactor of modules to use format strings accidentally got rid
of the `trim()` on the NodeJS version string. This just adds it back so
that the prompt doesn't include an unnecessary line break when showing
that module.
2020-07-10 11:41:25 -04: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
Tilmann Meyer
7edd0f6218
test(terraform): move tests which do not require env vars (#1455)
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-07-08 20:24:38 -04: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
Dario Vladović
ec0b577204
fix(ocaml): trim OCaml verison (#1436) 2020-07-05 21:51:04 -04:00
Walther Chen
489838e6a2
feat: git branch: read from HEAD on newly initialized repo (#1336)
* Git branch: read from HEAD on newly init repo

On a newly initialized git repo, there are no branches created until a
commit is made. Previously, starship handled this by having a default
branch "master" for when branch `head` could not be read.

However, if a user wants to set a different default branch name, that
name won't appear on starship until a commit is made to the branch.

If git2 provides a way to read the default branch name, we can use that,
but at the moment it's not obvious how.

For the moment, we can directly read `.git/HEAD`, which contains the
name of the default branch head reference. This commit implements this
strategy.

Closes #1327

* update git_branch test from unborn master to unborn default

* cargo fmt
2020-07-05 13:22:14 -04:00
Thomas Haessle
021d82a224
fix: manage sandboxed version of OCaml (#1433)
* fix: manage sandboxed version of OCaml

* fmt: apply cargo fmt

Co-authored-by: Thomas Haesslé <thaessle@cutii.io>
2020-07-05 13:20:11 -04:00
Thomas O'Donnell
6e289721d4
fix(custom): Fix fallback shell not working on macOS (#1402)
Have switched the fallback shell used when the custom module can't use
the default to use `/usr/bin/env sh` rather than `/bin/env` since
`/usr/bin/env` is more commonly available.
2020-06-28 15:41:05 -04:00
Thomas O'Donnell
affae806fb
refactor(custom): Add additional logging to the custom module (#1389) 2020-06-26 11:30:11 -04:00
Dario Vladović
e034d51cb2
feat(git): honor GIT_DIR environment variable (#1348) 2020-06-24 17:13:47 -04:00
Thomas O'Donnell
dbe6bdf031
refactor(config): Add additional logging to debug config issues (#1390) 2020-06-24 16:11:05 -04:00
dependabot-preview[bot]
f9bf2324e2
build(deps): bump path-slash from 0.1.1 to 0.1.2 (#1377)
* build(deps): bump path-slash from 0.1.1 to 0.1.2

Bumps [path-slash](https://github.com/rhysd/path-slash) from 0.1.1 to 0.1.2.
- [Release notes](https://github.com/rhysd/path-slash/releases)
- [Changelog](https://github.com/rhysd/path-slash/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rhysd/path-slash/compare/0.1.1...v0.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Fix tests to improve slash handling on Windows

* Fix number of slashes

* Try fixing the slashes again

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Matan Kushner <hello@matchai.dev>
2020-06-22 18:41:05 -04:00
Dario Vladović
d1bbba321b
test(nodejs): add test attribute to omitted tests (#1367) 2020-06-21 17:59:00 +02:00
Dario Vladović
b176fc35ac
feat(nodejs): support additional file patterns (#1311) 2020-06-21 10:33:58 +02:00
Daniel A. White
b238574100
feat(dotnet): adds additional files to detect .net projects (#1303)
* adds additional files to detect .net projects

* test .net output with a regex pattern
2020-06-21 10:22:20 +02:00
Julian Gehring
d21cb62e3a
Replace dirs with dirs-next dependency (#1361)
`dirs` will be unmaintained for the foreseeable future, so
switch to the maintained fork `dirs-next`.

Closes #1319.
2020-06-20 12:59:35 -05:00
SeongChan Lee
611a754ec7
fix(directory): Fix path contractions for symlinked git repos (#1299)
Fixes git repo path contractions in two situations:

1. When path obtained from `PWD` is a logical path but git libraries
   return physical paths.
2. When a git repository's subdirectory is symlinked to ouside of the
   repository tree.

(1) is fixed by implementing a realpath()-like function, then reparsing
the (possibly logical) `PWD` using realpath() to convert logical
components into physical ones. The physical paths are then matched
against each other.

In the case of (2), the default behavior has been changed by simply
contracting to the home directory, exactly the same as if we are not in
a repo at all. Because determining the correct contraction is not
obvious, we bail out and just pretend we are not in a repo at all.
2020-06-17 22:44:51 -05:00
anouar kappitou
feac3d56ce
fix: replacing default RUST_LOG environement variable with starship specific one, to prevent interlacing (#1280)
Co-authored-by: Kappitou Anouar <anourkappitou@gmail.com>
2020-06-14 20:22:34 +02: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
Thomas O'Donnell
c182572796
Fix PHP version including error messages (#1317)
PHP will output error messages when displaying the version if, for
example, there is something wrong with the local `php.ini` file. Have
updated the command used to get the PHP version to only use the default
PHP config.
2020-06-13 01:04:53 +02:00
Munif Tanjim
525dfef9a7
fix(bash): last command status and command duration (#1185)
* fix: character module last command status for bash

* fix: command duration module for bash
2020-06-10 18:53:56 +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
Nemo157
fb121cd62a
fix: Retain previous command state on zsh keymap select (#958) 2020-06-09 18:52:29 +02:00
Thomas O'Donnell
5b14f21394
refactor: latest suggestions from Clippy 2020-06-05 23:20:11 -04:00
Nathan West
c04a0eb1d1
feat: add shell completion generation command (starship completions) (#881) 2020-06-03 11:25:51 -04: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
Dario Vladović
cf87ce5f50
style(init): tidy-up init scripts (#1269)
* style: fix indent & spacing

* chore: use consistent function definition style

* chore: remove extra semicolon

* chore: flip comparison expression
2020-05-28 12:21:36 -04: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
Hendrik Rombach
108193103d
fix(git): show branch name in fresh repo (unborn master) (#1093)
* fix: branch_name in fresh repo (unborn master)

* test: add test for unborn branch_name fix
2020-05-06 11:19:53 +02:00
Jean Gautier
02edad0c66
fix(directory): avoid confusing modules with PowerShell paths (#1114)
* Avoid confusing modules with PowerShell paths

* Avoid confusing modules with PowerShell paths

Powershell supports PSDrives (https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-psdrive?view=powershell-7) that allow to create "logical" drives mapped to actual Windows drives.

* Preserve Windows directories

* Preserve logical paths for Powershell

* Fix formating with cargo fmt

* Fix directory_in_root test

Co-authored-by: Jean Gautier <jean.gautier@ssi.gouv.fr>
2020-04-30 10:40:56 +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
Oisín
8e8519552f
fix(haskell): avoid creating .lock files or downloading GHC (#1147)
* (Haskell) avoid creating .lock files or downloading GHC

* Fix stack command in mock expectations for Haskell module + befriend cargo fmt
2020-04-28 10:07:18 +02:00
Benedikt Reinartz
8c17f7b97c
feat(erlang): Add Erlang module (#1129) 2020-04-27 12:09:42 +02:00
John Letey
a3fef5becf
feat: Modify config keys from shell (#1095)
* feat: Modify config keys from shell

* chore: Fix clippy

* refactor: Add `configure` as alias

* chore: Remove redundant code

* fix: Soft error if user doesn't pass in valid key

* feat: Support integers and booleans

* chore: Fix clippy

* refactor: Use exit instead of abort

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

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-04-26 15:58:39 +02:00
Alexandru Macovei
decd4e2a5d
fix(haskell): add description for haskell, used by the explain command (#1141) 2020-04-25 14:34:01 +02:00
Alexandru Macovei
2c30f4bd9e
fix(crystal): Add Crystal module to default prompt order (#1140) 2020-04-24 19:37:34 +02:00
Thomas O'Donnell
060689fa88
fix: Fix latest clippy suggestions (#1136)
Have removed some imports that Clippy says are not needed anymore.
2020-04-24 12:37:13 +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
Thomas O'Donnell
beed0acc6c
fix(python): Fix venv name not showing when using pyenv (#1046)
This fixes an issue where the name of the virtual environment is not
being shown when using the `pyenv_version_name` setting.
2020-04-14 10:23:57 +02:00
Thomas O'Donnell
05e323da75
chore: Add more detailed logging for executing cmds (#1097)
This makes some changes to the logging to make debugging what is
happening a bit easier when we run external commands.
2020-04-13 15:22:28 +02:00
Thomas O'Donnell
391add767f
revert: fix(git_branch,git_status): implement fallback branch_n… (#1092)
This reverts commit 8d90baf0eb.
2020-04-11 16:10:39 -04:00
Grégoire Geis
15dc486e72
Add support for custom modules. (#916) 2020-04-11 18:37:24 +02:00
Jonathan Knapp
19e8301ff1
Fix ruby version to not assume length (#1082) 2020-04-10 18:41:14 +02:00
Zhenhui Xie
b11fe2ad30
fix: Fix variable styles in string formatter (#1069)
* fix: Fix styling in variables

* fix: Fix clippy

* fix: Allow passing styles down to segments with no style

* fix: Fix clippy
2020-04-10 18:23:20 +02:00
Udo Kramer
d27b263023
feat(package): Add project version for Elixir (#1067) 2020-04-08 18:39:54 +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
Hendrik Rombach
8d90baf0eb
fix: implement fallback branch_name for bare git repos (#1035)
closes #686
2020-04-07 12:01:40 +02:00
Zhenhui Xie
b905743364
fix: Fix typo (#1054) 2020-04-07 11:58:10 +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
Zhenhui Xie
22dc419a3e
improvement: add parser for format strings (#1021)
This PR implements the parser of format strings described in #624.
2020-04-06 13:16:18 -04:00
Kevin Pullin
9924af55db
feat(aws): Use AWS_VAULT as the profile if set (#984)
* Use AWS_VAULT as the profile if set

[aws-vault](https://github.com/99designs/aws-vault) sets
the `AWS_VAULT` env var instead of `AWS_PROFILE` when an
aws-vault session is active.

This PR adds support for reading the AWS profile value from
the `AWS_VAULT` env var, giving priority to `AWS_VAULT` if both
it and `AWS_PROFILE` are set.

* Update docs for AWS_VAULT
2020-04-06 16:59:56 +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
Shu Kutsuzawa
bd016b6ce2
feat: Enable to display language version when .<lang>-version file exists. (#1028)
* adjust https://github.com/sonnym/elmenv

* adjust https://github.com/syndbg/goenv

* adjust https://github.com/jenv/jenv

* adjust https://github.com/nodenv/nodenv

* adjust https://github.com/phpenv/phpenv

* adjust https://github.com/rbenv/rbenv

* add description

* golang.rs is executed rustfmt

* add testcases
2020-04-03 21:02:28 +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
Shu Kutsuzawa
edcec7eed8
feat(package): Add project version for julia (#1036)
* add project version (for julia) to package module

* update docs
2020-04-03 20:16:22 +02:00
David Knaack
55503bb77b
perf(dotnet): fail faster in the dotnet module (#1034) 2020-04-03 12:34:35 -04:00
Matan Kushner
bbba4e1657
fix: change command failure log level to trace
Closes #1020
Closes #1024
2020-03-22 17:58:46 -04:00
David Knaack
56d475578e
fix: possible fix for Intermittent Test Failures in GH Actions (#987)
* fix: possible fix for Intermittent Test Failures in GH Actions

* undo some of the chnages to directory.rs

* typo

* add docs
2020-03-15 12:12:25 -05:00
David Knaack
fef8cc8bbd
improvement: replace reqwest with attohttpc (#999) 2020-03-14 21:07:34 -04:00
Thomas O'Donnell
f790b67e3d
refactor: Fix new Clippy suggestions (#1006)
* Fix new Clippy suggestions

This just cleans up a few new suggestions from Clippy.

* Dummy commit to trigger CI
2020-03-14 11:37:51 -04:00
Basix
8b4489768b
fix(utils): print log for exec_cmd failure (#982) 2020-03-06 16:17:34 -05:00
Matan Kushner
d894ef5ad3
feat: make reqwest an optional dependency (#979) 2020-03-05 10:53:58 -05:00
Kevin Song
7f82dd66ed
fix: check if editor is not found for configure (#961)
* fix: check if editor is not found for `configure`

STD_EDITOR falls back on `vi` if $EDITOR and $VISUAL is not set.
However, some machines might not have `vi` symlinked or installed and a
bad error message is displayed. This commit adds a better error message.

* fix lint errors

* Change NotFound to write to stderr instead of panic!

Oh wow writing rust makes my commit messages look very enthusiastic!
2020-03-05 09:50:34 -06:00
Matan Kushner
d0e1904758
feat(package): ignore private JS packages (#975)
`private: true` in `package.json` files means that the package is not supposed to be published to npm, which makes the `version` field meaningless, so we should probably ignore it to not clutter the prompt too much.
2020-03-05 10:49:11 -05: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
Kevin Lane
ce540fff7a
feat: display Gradle project version (#662)
This PR adds package version support for Gradle projects. The version number is extracted from the `build.gradle` file in the current directory, similar to existing support for other packages.
2020-02-21 14:12:21 -05:00
Thomas O'Donnell
d44c037ba5
test: refactor ruby and php modules to use mocked commands (#936) 2020-02-21 11:52:39 -05:00
Onielfa
ddd8cfb388
perf: refactor git status to use HashMap for counts (#938) 2020-02-14 20:38:25 -05:00
nesmyslny
0312c7b91e
feat(git_commit): Show the hash of commits when detached HEAD (#738) 2020-02-12 14:56:29 -05:00
Thomas O'Donnell
67397d9096
test(golang): refactor golang tests to use mocked command (#925)
Refactor the golang module tests to use a mocked command and no
longer depend on having a particular version of Go installed.
2020-02-12 13:22:21 -05:00
Brett Mandler
bc600e4321
feat: Add cabal and hpack detection for the haskell module (#915) 2020-02-06 19:29:57 -05:00
Jon Grythe Stødle
2509a79176
fix: Change command duration variable for Ion shell to CMD_DURATION (#911) 2020-02-06 14:41:55 -05:00
Andrew Prokhorenkov
cead23edca
test: port Haskell module tests to integration test (#913) 2020-02-06 12:12:07 -05:00
Kevin Song
c4ab66d7fe refactor: Move ANSI escaping into its own functions (#866) 2020-02-06 11:10:59 -05:00
Matan Kushner
66d5f34184 chore: give unused function a test annotation
Former-commit-id: 94acaa37c593f4952c349d663de71e3f1990926b
2020-02-05 23:03:26 -05:00
Matan Kushner
21f2947222 revert: "refactor: replace reqwest with ureq (#844)" (#895)
Former-commit-id: 0908c12a4950b6b4ceea22a3e1cbd4a8039d4006
2020-02-05 22:58:39 -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
Kyle Sferrazza
752abd4bfb
fix: make echo test use /bin/sh (#892) 2020-02-04 12:48:01 -05:00
Matan Kushner
860accac55
chore: readd from_path function
Despite the function not being used directly, it was being used in tests.
Readding the function so tests will pass.
2020-02-03 17:13:59 -05:00
Matan Kushner
f14aef4769
chore(bump): v0.34.1 2020-02-03 17:04:16 -05:00
Matan Kushner
0d1578bbe1
fix: move get_shell method into Context 2020-02-03 17:01:50 -05:00
Sam Rose
83337a1a03
perf: Optimize files, folder and extension lookups in Context (#880) 2020-02-03 16:57:48 -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
Luca Rinaldi
041c0427bb fix: escape "$" character to avoid bash interpreting (#884) 2020-01-28 13:55:16 -05:00
Kevin Song
5655a90a28
fix: Restrict clear screen control code printing to fish (#865)
Wraps clearscreen print codes in a statement to detect fish shell, since it is a
workaround for a fish shell behavior.
2020-01-27 17:23:08 -06:00
Matan Kushner
3365beae09 test(nodejs): Port nodejs module tests from E2E to integraton (#867)
Replaces the existing nodejs module end-to-end tests with integration tests that don't require preinstalled environmental dependencies.

- Moved the tests to the same file as the module they test
- Created a render_module utility function for rendering modules within tests
- Removed Node.js installation during CI setup
- Add Shell to Context to allow for tests to not run shell-specific code
2020-01-26 16:37:18 -06: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
Sam Rose
f4c095de92 fix(java): Add detection for *.gradle files (#871)
Currently the Java module detection looks for build.gradle specifically, but it's possible to rename build.gradle to *.gradle. This change adds Gradle files to the list of detected file extensions.
2020-01-24 10:22:30 -05:00
Peter Bull
b723a7d562 fix(python): Trim "Anaconda, Inc." from version (#861) 2020-01-21 11:14:40 -05:00
David Knaack
d869b3a098 refactor: replace reqwest with ureq (#844) 2020-01-19 11:00:40 -05:00
Thomas O'Donnell
197376633a fix: Fix incorrect prefix usage in cmd_duration module (#832)
Fixed the way the cmd_duration module is setting it's prefix to be the
same as the other modules.
2020-01-18 01:15:08 -06:00
Jon Grythe Stødle
313a03e2b7 fix(bug-report): Fix status code 414 when generated bug report is too long (#750) 2020-01-15 23:47:56 -05:00
Thomas O'Donnell
0fe90bf018 refactor(dotnet): Use exec_cmd util (#826)
Have refactored the dotnet module to use the util::exec_cmd rather than
the Command module directly.
2020-01-15 13:52:38 -05:00
Thomas O'Donnell
60ce320912 refactor(php): Use exec_cmd util(#825) 2020-01-12 17:50:25 -05:00
Thomas O'Donnell
0d81694e32 chore: Add ability to mock commands during tests (#768) 2020-01-11 10:08:32 -05:00
Hendrik Rombach
dab27f3334 fix: Correct module description text for git_commit (#812) 2020-01-07 12:12:40 -05:00
dependabot-preview[bot]
a251ddb957 build(deps): bump reqwest from 0.9.24 to 0.10.0 (#797)
* build(deps): bump reqwest from 0.9.24 to 0.10.0

Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.9.24 to 0.10.0.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.9.24...v0.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-06 12:10:30 -05:00
InNoobWeTrust
2eeaa05bfb feat: Terminate $PROMPT_COMMAND properly (#799)
Add trailing semicolon to end $PROMPT_COMMAND properly.
This will prevent starship_precmd to accidentally mess with other hooks invoked after it.
2020-01-04 10:52:08 -05:00
David Hewson
178f177dac perf(hg_branch): Replace direct calls to hg (#803)
perf: don't use hg process to get branch / bookmark information, each call was taking 250ms and it was making on average 2 calls.
the branch and bookmark information is available in files in the root of the repo, use that instead.
now takes 300 micro seconds

fix: do not use .hgignore to decide if it is an hg repo. was providing false positives. #721

fix: after changing branch the new branch was not show (the old branch was shown), the new branch is now correctly shown. #722

fix: if no branch override was set it would say (no branch) however if you commited in that state you would commit to the branch default so say that instead
2020-01-03 17:51:45 -05:00
Jon Grythe Stødle
8e5fa60fc8 feat: Add the starship explain command (#699)
This adds the explain argument to Starship, which explains what the printed modules in the prompt are.
2020-01-01 23:19:08 -05:00
AppleTheGolden
6bafe4cd66 fix: Consider $STARSHIP_CONFIG in configure (#795)
Makes starship configure consider the $STARSHIP_CONFIG variable before falling back to the default of ~/.config/starship.toml.
2019-12-30 15:46:02 -08:00
marblenix
b82ff321fa feat(git_status): Add a stash count segment (#598) 2019-12-28 22:20:36 -05:00
InNoobWeTrust
9d49410102 fix: Remove trailing semicolon from $PROMPT_COMMAND (#784)
Remove any trailing semicolon in $PROMPT_COMMAND before appending starship_precmd, to prevent syntax error.
2019-12-28 10:03:59 -05:00
Tobias Bieniek
ecc8754335 fix(package): Use specified directory instead of current working directory (#774) 2019-12-23 22:38:00 -05:00
Dominik Braun
56d62bd659 fix: Parse arguments of $VISUAL and $EDITOR (#772)
Co-authored-by: AppleTheGolden <scotsbox@protonmail.com>
2019-12-23 10:27:00 -05:00
Leonora Tindall
539f320a3f fix: Improve error message when current dir is not found (#773) 2019-12-21 23:26:57 -05:00
Matan Kushner
8cf4ce21d9
perf: Dereference before to_string in aws module 2019-12-20 12:58:59 -05:00
Mike Sampson
256a2be949 feat: Implement AWS region aliases (#646) 2019-12-20 12:30:47 -05:00
AppleTheGolden
11f73efa41 fix: Improvements to starship configure (#756)
- look for $VISUAL first, then $EDITOR, then the default
- panic if we can't find the home dir
2019-12-20 09:55:53 -05:00
Jon Grythe Stødle
f898b22b55 fix: Clear before printing prompt (#739)
This clears any leftover text when the prompt updates in-place (e.g. Alt + Left/Right in fish shell)
2019-12-19 17:56:30 -05:00
Luca Rinaldi
6a2b0a67b0 feat: cmd_duration module optionally reports milliseconds (#696) 2019-12-19 17:38:06 -05:00
Etienne Mabille
879649d542 fix(bash): save and restore "$_" (#753) 2019-12-19 16:20:44 -05:00
Mario Arias
aab35674d2 feat: Adds build.gradle.kts detection to the Java module (#731) 2019-12-19 10:17:50 -05:00
Dominik Braun
a4c5c00a73 feat: Implement starship configure command (#751) 2019-12-18 16:09:36 -05:00
Matan Kushner
6c2e931087
feat: Extend bug-report to include terminal emulator (#740) 2019-12-17 10:17:04 -05:00
Matan Kushner
2edccd8848
docs: Update bug report template 2019-12-15 19:27:23 -05:00
Jon Grythe Stødle
76804cc3c8 feat: Add bug-report sub-command (#725)
This adds a sub command to generate the link. Information, such as operating system and it's version; the current shell's config; and current starship conf, is gathered from the environment and is included in the pre-filled text. The command will also try to open the link in the default browser. Should that fail it will print the link instead and ask the user to copy it.
2019-12-14 18:40:12 -05:00
David Knaack
6724ce5bb5 fix(powershell): % sign was prefixed with ` (#730) 2019-12-13 14:55:20 -05:00
Brian Low
12e8ae85dd fix: Wrap prefix and suffix in shell-specific escape codes (#712) 2019-12-13 14:35:10 -05:00
David Knaack
b2ebd24506 fix(powershell): Fix prompt not updating on -nix systems (#728)
Closes #661
2019-12-13 13:44:58 -05:00
dependabot-preview[bot]
d71373b265 build(deps): bump sysinfo from 0.9.6 to 0.10.2 (#711) 2019-12-12 15:32:46 -05:00
Morten Scheel
e38a257656 feat: add composer.json version to Package module (#716) 2019-12-11 21:05:39 -05:00
BuggStream
93701b26b3 feat: Add support for the ion shell (#704) 2019-12-11 15:31:30 -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 Rinaldi
1558b22bb0 fix: multiple batteries support in the battery module (#669)
Closes #656
2019-12-03 11:48:50 -05:00
Thomas O'Donnell
edc62f4518 refactor: Refactor modules to use the exec_cmd util (#676)
Have refactored the golang, java, nodejs, python, ruby and username
modules to use the new `exec_cmd` util.
2019-12-02 17:42:55 -05:00
Luca Greco
337f213753 feat: Add the hg_branch module (#569) 2019-12-02 17:37:18 -05:00
Raidou
2a75a18eb1 fix: Fix panic when using fish-style pwd with unicode symbols (#672) 2019-11-29 00:02:22 -05:00
Thomas O'Donnell
f5bbaef82b chore: Add a helper function for executing commands (#660) 2019-11-27 17:03:08 -05:00
Thomas O'Donnell
45d977aa39 fix: Remove duplicated "v" in package versions (#648) 2019-11-20 09:16:07 -05:00
Matias Kotlik
135dddbb4f feat: Add separator config to the memory module (#603) 2019-11-13 10:57:46 +09:00
Thomas O'Donnell
fc2f644237 fix: Add support for multiple Kubeconfig files (#635)
This adds support for having multiple Kubeconfig file set as part of the
`KUBECONFIG` env var.
2019-11-12 14:34:01 +09:00
Zhenhui Xie
5bb7467b56 refactor: Cleanup after module config refactor (#630) 2019-11-07 12:38:30 +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
Thomas O'Donnell
42f6868e3f feat: Enable the python module in virtual envs (#584)
This will enable the python module when a virtual environment has been
activated, this is detected via the `VIRTUAL_ENV` env var.
2019-11-02 20:10:21 +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
Matias Kotlik
e01c41eddf style: Clean up Golang module (#612) 2019-11-01 10:53:28 +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
Matias Kotlik
221f07548c fix: Disable venv custom prompt when starship is in use (#551) 2019-10-25 21:41:00 +09:00
Zhenhui Xie
321e440289 chore: Move StarshipRootConfig to a separate file (#581) 2019-10-25 10:08:09 +09:00
yuri
b7762a3e91 fix: Show Java version from OpenJ9 Java runtimes (#507)
This PR tries to improve the version detection across multiple Java VM vendors. The module captures both STDOUT and STDERR outputs of the java -Xinternalversion call.

Eclipse OpenJ9, Azul Zulu, SapMachine, Amazon Corretto and GraalVM outputs are unit tested now.
2019-10-25 10:00:05 +09:00
Zhenhui Xie
aa260899d4 fix: Use logical path instead of physical path when available (#398)
* Get pathbuf from logical path. (fixes #204)

(also fixes #397)

* fix: Update directory module so that use_logical_path will work properly

* Remove test directory::use_logical_and_physical_paths

* Fix merge errors


Co-authored-by: Matan Kushner <hello@matchai.me>
2019-10-24 19:37:44 +09:00
Thomas O'Donnell
e0c90a6502 refactor: Remove to remove unneeded mutability (#577)
Removed a couple of unneeded `mut`s that were pointed out by `cargo
check`.
2019-10-24 19:31:17 +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
Thomas O'Donnell
7b9197a67e fix: Fix the python module ignoring error codes (#563)
This is a quick fix to stop the python module from displaying error
messages that have been printed to stderr as the version.
2019-10-20 17:42:27 +09:00
Clément Joly
7e21f5c6b6 Refactor: Remove unnecessary parentheses in if condition (#566) 2019-10-20 17:36:02 +09:00
Barnaby Keene
2c7e01cd62 refactor: improve as-a-library usage by removing ArgMatches depe… (#547)
This removes ArgMatches from the Context struct and replaces it with a simple HashMap. This work is towards getting Starship in a better place for use as a library in other shells written in Rust so they don't need to use a command-line interface to invoke and configure things.

Contributes to #521
2019-10-20 17:26:27 +09:00
Zhenhui Xie
aadd8ecf2c refactor: Refactor modules to use module config (#514) 2019-10-19 10:51:38 +09:00
Nguyễn Hồng Quân
27fad02837 fix: Separate Python version string and env name (#548) 2019-10-17 18:55:48 +09:00
David Knaack
6ab70796db feat: Implement PowerShell support (#470) 2019-10-16 00:10:16 +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
Keith Wade
10efe3e320 fix: Show leading slash when truncating from root (#526) 2019-10-15 00:12:43 +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
Barnaby Keene
9f365f84d1 refactor: Allow starship to be better used programmatically (#509)
Structure the prompt as a function that returns a string instead of writing directly to stdout.

This makes it easier to embed Starship into other Rust programs such as shells written in Rust. It also decouples the arguments from the context for more programmatic initialization of the context.
2019-10-09 10:43:28 +09:00
Maarten Mulders
8058b51273 feat: Show Java module when build.sbt is present (#505)
* feat: Show Java icon and info when build.sbt detected

* docs: Mention build.sbt detection
2019-10-07 19:18:01 +09:00
(´⌣`ʃƪ)
77c25b60c2 fix: Don't print the first module prefix after a line-break (#473) 2019-10-07 00:46:46 +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
Zhenhui Xie
044e10de1b chore: Import shared types from super (#492)
Changes imports statements to make imports more uniform.
2019-10-05 16:13:03 -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