Commit graph

567 commits

Author SHA1 Message Date
David Knaack 8af677c811
feat(config): print a suggestion for unknown fields (#2560)
* feat(config): print a suggestion for unknown fields

* Fix typo

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

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2021-04-06 22:12:37 +02:00
Dario Vladović c7d5ce72b5
refactor(init): cleanup init stub (#2548)
* refactor(init): cleanup init stub

* refactor(init): use iex PowerShell alias

* fix(init): prevent bash scope pollution

* refactor(init): update PowerShell snippet
2021-04-05 16:52:10 +02:00
Charles Swartz 2b0010ffe3
feat(python): Remove parentheses from pyvenv.cfg prompt parameter (#2551)
* Remove parentheses from pyvenv.cfg prompt

* Apply suggestions from initial code review

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

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>
2021-04-05 16:51:01 +02:00
David Knaack b791383a94
fix(configure): fix print-config issues (#2556) 2021-04-05 16:47:49 +02:00
Dario Vladović e19f79bfd3
style(battery): add space between icon and text for better visual (#2547)
* style(battery): add space between icon and text for better visual

* docs(battery): update docs

Co-authored-by: LitoMore <litomore@gmail.com>
2021-04-03 13:10:45 +02:00
Dario Vladović dbb6885724
feat(ocaml): add switch_indicator and switch_name variable (#2503)
* feat(ocaml): add switch variable

* feat(ocaml): configurable opam switch display

* docs(ocaml): document opam switch display options

Add `global_switch_indicator` and `local_switch_indicator` config
options.

* style(opam): add `OpamSwitch` type alias

* fix(opam): gracefully handle empty opam switch

Co-authored-by: cdaringe <cdaringe@gmail.com>
2021-04-02 19:21:48 +02:00
Thomas O'Donnell 7779ed6075
style(directory): Add comments for test settings (#2538)
Have added some comments to explain the settings we are using in some
tests.
2021-04-02 06:18:40 +02:00
Kim Christensen 70b397a1c4
fix(git_branch): Make Git branch module support bare repositories (#2522)
Co-authored-by: Kim Christensen <KMCH@simcorp.com>
2021-04-01 18:51:55 +02:00
David Knaack 51972801de
feat(config): warn about unknown config key names (#2527) 2021-03-31 20:13:23 +02:00
David Knaack 9d15eb135b
test(directory): fix on windows without admin (#2497) 2021-03-31 18:00:24 +02:00
David Knaack d06ba072a8
feat(config): allow printing default and computed config (#2521)
* feat: allow printing default and computed config

* fix custom modules

* actually fix custom modules
2021-03-31 17:31:55 +02:00
Caleb Maclennan f13e44c730
feat(vcsh): Add new module for VCSH (#2513)
* feat(vcsh): Implement new VCSH module

* test(vcsh): Add unit tests for VCSH module

* docs(vcsh): Document VCSH module
2021-03-28 17:48:15 +02:00
Dario Vladović 404b4f3d0c
refactor(username): reformat code to match docs (#2517) 2021-03-27 22:13:20 +01:00
Dario Vladović 1336944ab7
refactor(singularity): use ? operator (#2518) 2021-03-27 18:53:54 +01:00
David Knaack cf68f54611
fix(context): remove unwrap when pwd is unavailable (#2520) 2021-03-27 11:46:05 -04:00
Dario Vladović c8a787475c
refactor: use unwrap_or_default (#2516) 2021-03-26 21:01:20 +01:00
Thomas O'Donnell e0da57df3f
style(init): Cleanup the unknown shell message (#2444)
* style(init): Cleanup the unknown shell message

Have make a small change to the message that is printed when an unknow
shell is used. This correct the placement of the trailing `"` so that
the two training new lines are correctly printed and updates the list of
supported shells.

* refactor(init): consolidate unknown shell errors

Have consolidated the two unknown shell errors

* refactor(init): Quote the shell name in the output

Quote the shell name in the script and combined the shell_name and
shell_basename to simplify the code a little.
2021-03-25 15:08:28 -05:00
David Knaack ba40ad5ce6
chore(clippy): fix new lints (#2507) 2021-03-25 16:03:19 -04:00
Chris Rose aa7a8056bb
fix: Add a missing ' ' to the end of the python prompt (#2248)
Co-authored-by: Chris Rose <offline@offby1.net>
2021-03-24 10:41:08 -05:00
Andy Freeland 3513aae3ed
fix(shell): Support conditional format strings for $indicator (#2489)
Previously attempting to use conditional format strings with
`$indicator` would never display an indicator, e.g.:

```toml
[shell]
fish_indicator = ""
bash_indicator = "B "
format = "($indicator )"
disabled = false
```

This would always display an empty string.

Fixes #2474.
2021-03-23 17:20:29 -04:00
Zachary Dodge 0a091bd236
perf(git_status): replace git2 in git status module with git cli (#2465) 2021-03-23 12:45:27 -04:00
Eyal Cherevatzki 612cc7d27b
refactor(dotnet): ".NET" instead of "•NET" (#2471)
* refactor(dotnet): ".NET" instead of "•NET"

"•NET" looks quite weird, especially since the official writing is ".NET".

* revert(docs): translated docs

Co-authored-by: Eyal Cherevatzki <eyal@hyperguest.com>
2021-03-18 18:46:54 +01:00
David Knaack 052b56fe10
refactor: replace RootModuleConfig with Default (#2458) 2021-03-15 11:40:52 +01:00
Eric Nielsen 6fd7d7b501
fix(zsh): Set PROMPT just once (#2428)
No need to forcefully set the `PROMPT` variable every time the prompt is
to be shown. Just set it once, leaving the command to be evaluated every
time the prompt is to be shown, by enabling the `promptsubst` option.

Setting it once is also friendlier to users that want to experiment with
another prompt theme by temporarily setting `PROMPT` to something else.
This would currently not be possible, because the variable is always
reset before every prompt draw (precmd) and keymap change
(zle-keymap-select).

Some other updates to take better advantage of the zsh script dialect:

  * `$` is not required to read variables inside `(( ))` arithmetic
    expressions.
  * The zsh dialect to check if a variable is set is `${+var}`. Better
    than `${var+1}`, which substitutes 1 if var is set, which is
    intended for more general substitutions, not just to check if var is
    set.
  * The number of jobs can be read using the `%j` escape sequence, which
    is expanded when the `promptpercent` option is set.

Also simplified a couple of code lines by avoiding a temporary
`STARSHIP_START_TIME` variable, since we already have
`STARSHIP_CAPTURED_TIME`.
2021-03-15 11:39:35 +01:00
Melroy van den Berg c91b293c9d
fix(cmake): Change cmake symbol to unicode triangle (#2456) 2021-03-15 11:27:54 +01:00
Beni Ben zikry dd5c62791c
feat(scala): Add scala module (#2409)
* Add support for scala ( w/o sbt )

* Add scala description

* Change scala color to bold red

* update scala extensions in README

* failed lint

* cr changes ( regex, simplify parsing, imports )

* Scala readme punctuation

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

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2021-03-14 20:37:00 +01:00
Asger Hautop Drewsen d2946ddff7
fix(python): Handle PyPy python version correctly (#2374)
* fix(python): Handle PyPy python version correctly

* refactor: rework Python version retrieval and formatting

Align Python version retrieval and formatting with established
Starship conventions.
2021-03-14 19:27:19 +01:00
Thomas O'Donnell 50bc5d9134
fix(java): use consistent separators for java path (#2455)
* fix(java): use consistent separators for java path

This switches us from just appending `/bin/java` to `$JAVA_HOME` to
treating `$JAVA_HOME` as a path. This should fix any issues on Windows
where $JAVA_HOME might use `\` rather than `/`.

* test(java): add test for JAVA_HOME

* refactor: remove duplicate defaults

* perf: sligntly better java path perf

* Update src/modules/java.rs

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

* Update src/modules/java.rs

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

* Update src/modules/java.rs

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

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>
2021-03-13 17:09:40 +01:00
nils måsén e5cdd9c1b3
feat(aws): add support for getting profile from awsu (#2451) 2021-03-13 09:35:50 +01:00
Bao, Huang-Huang 8f46dff9dc
fix(package): fix meson version extraction if 'meson_version' is present (#2397) 2021-03-12 15:30:25 +01:00
Eric Nielsen fb6cefa4b5
style(aws): Add spacing between profile and region (#2417)
and also after the symbol when using the Nerd font glyph.
2021-03-06 20:47:06 +01:00
David Knaack 7385dc27a9
fix(bash): escape interpretable characters (#2404)
* fix(bash): escape interpretable characters

* also escape backticks
2021-03-05 01:47:07 -06:00
Vivek Malneedi d21400a478
feat: add support for tcsh (#2288)
* feat: add support for tcsh

* add tcsh to install.sh install message

* list tcsh in bug_report.rs and main.rs

* quote starship path

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

* fix job count

* add tcsh support to shell module

* fix STARSHIP_START_TIME undefined error

* preserve existing user precmd and postcmd, remove jobs support

* remove unnecessary parentheses

* minor script improvement

* removes parens from install script message

* Update docs/config/README.md

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

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2021-02-27 19:55:27 +01:00
whi-tw 4d3a4f230d
fix(nodejs): Change symbol to nerd-font (#1649)
The unicode hexagon symbol does not actually fit into a single column with a
fixed-width font.  does. As starship requires a nerd font as a prerequisite, 
it's safe to assume that this symbol is available.
Symbol link: https://www.nerdfonts.com/cheat-sheet?set=nf-mdi-nodejs

In the documentation, I've left the '⬢' symbols in '#### Text Group' as
they are, as they will continue displaying correctly in a browser
without a nerd font available. I feel like readability is more important
than consistency with the new nodejs symbol, especially as this
documentation section does not actually refer to nodejs, rather it's
just a symbol.

As `⬢` has been replaced, use `⌘` instead in documentation to avoid
any possible confusion
2021-02-22 14:10:36 -06:00
Thomas O'Donnell 0083e28827
feat(helm): Configure when the module is shown (#2352)
This makes it possible to configure when the helm module is shown based
on the contents of a directory.
2021-02-21 19:57:23 +01:00
Thomas O'Donnell 64288c2e04
feat(java): Configure when the module is shown (#2353)
This makes it possible to configure when the java module is shown
based on the contents of a directory.
2021-02-21 19:57:09 +01:00
Thomas O'Donnell c0a209f27c
feat(julia): Configure when the module is shown (#2358)
This makes it possible to configure when the julia module is shown
based on the contents of a directory.
2021-02-21 19:56:55 +01:00
Thomas O'Donnell 1a6c625521
feat(kotlin): Configure when the module is shown (#2359)
This makes it possible to configure when the kotlin module is shown
based on the contents of a directory.
2021-02-21 19:56:48 +01:00
Shu Kutsuzawa fe6f9eeb4d
feat(purescript): Configure when the module is shown (#2357)
This makes it possible to configure when the purescript 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 19:53:10 +01:00
Shu Kutsuzawa efb82454f2
feat(php): Configure when the module is shown (#2356)
This makes it possible to configure when the php 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 19:52:19 +01:00
Shu Kutsuzawa 51f752f6b0
feat(perl): Configure when the module is shown (#2355)
This makes it possible to configure when the perl 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 19:51:36 +01:00
Shu Kutsuzawa e73581ddf0
feat(ocaml): Configure when the module is shown (#2354)
This makes it possible to configure when the ocaml 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 19:50:40 +01:00
David Knaack 509767adc0
feat(swift): Configure when the module is shown (#2349)
This makes it possible to configure when the swift module is shown
based on the contents of a directory.
2021-02-21 18:01:31 +01:00
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