Commit Graph

49 Commits

Author SHA1 Message Date
dependabot-preview[bot] df5a7994c6
build(deps): bump rand from 0.7.3 to 0.8.0 (#2016) 2020-12-25 18:08:07 +00:00
David Knaack be882fcda9
fix(windows): configure console to enable ANSI support (#1646) 2020-11-11 20:24:43 +01:00
jRimbault 95bb901b8a
chore: fix the double compiling of lib and bin (#1616)
* fix: rust modules are compiled twice

The modules being declared both in the _library_ crate and the _binary_
crate made cargo compile everything twice:

1. for the library
2. for the binary

What happened was:

1. The library "starship" was compiled.
2. The binary "starship" (and all its modules) were compiled.

* fix: stop compiling every rust module twice

restrict visibility

* Run cargo fmt

* Add bug_report module

Co-authored-by: Matan Kushner <hello@matchai.dev>
Co-authored-by: Kevin Song <chips@ksong.dev>
2020-10-17 11:09:27 +02: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 6426bbe3e4
feat: Add timings subcommand (#1629)
* feat: Add computational duration to all computed modules

This also means that in case we do some computations and these end up empty, we submit an empty module

* feat: Add timings subcommand

This outputs the timings of all computed modules, sorted by the duration it took to compute the module.

Useful for debugging why the prompt takes so long.

* feat: Add timings to explain output

* fix: Ensure that even empty custom modules get timings

* format main.rs

* feat: Only show interesting timings

* fix(tests): Change tests to look for empty string instead of None

* Use proper wording in timings help

* Revert "fix(tests): Change tests to look for empty string instead of None"

This reverts commit aca5bd1b03c48e1dee1b7ca91d66e2bda2d5a97c.

* fix(tests): Returning None in case the module produced an empty string

* fix: Ensure that linebreaks (and space) make a module not-empty

* Make cargo clippy happy

* Make Module.duration a proper Duration

* Only return a module if we would report it

* Change to cleaner way to return None for empty modules

* Avoid unnecessary module creation

* Simplify a string comparison

* Add timings to trace

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

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-09-21 19:06:15 +02:00
Tilmann Meyer 88b603be38
test: introduce env variable mocking (#1490) 2020-08-07 15:13:12 -04: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
Nathan West c04a0eb1d1
feat: add shell completion generation command (`starship completions`) (#881) 2020-06-03 11:25:51 -04: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
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
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
Luca Rinaldi 6a2b0a67b0 feat: cmd_duration module optionally reports milliseconds (#696) 2019-12-19 17:38:06 -05:00
Dominik Braun a4c5c00a73 feat: Implement `starship configure` command (#751) 2019-12-18 16:09:36 -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
BuggStream 93701b26b3 feat: Add support for the ion shell (#704) 2019-12-11 15:31:30 -05:00
David Knaack 6ab70796db feat: Implement PowerShell support (#470) 2019-10-16 00:10:16 +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
Zhenhui Xie dd0b1a1aa2 refactor: Refactoring config (#383)
This PR refactors config and puts configuration files for all modules in `configs/`.
2019-09-30 21:10:35 +09:00
Quinn Strahl 3dd035056d Support vicmd_symbol in fish-shell (#254) 2019-08-31 00:59:18 -07:00
Bruno Bigras 68cbcb91b7 Use full path to starship in all phases of init (#224) 2019-08-22 12:57:32 -07:00
Saurav Sharma 075a76897c fix: Change panicking on unknown module to error print and support module listing flag (#197) 2019-08-20 00:42:25 -04:00
Kevin Song 0e82c19f37
feat: Implement a two-phase init which allows us to write normal init scripts (#168)
Implement a two-phase init procedure in starship. The first phase causes the shell to source a subshell, while the second phase (in the subshell) prints the main init script.

This allows us to have nice init scripts with good styling, comments, and no pile of semicolons. Even better, it works as a drop-in replacement, so we don't need to update the docs.
2019-08-19 18:44:53 -07:00
Shu Kutsuzawa d90c43b8b1 feat: Display Vi mode as PROMPT (#169)
Add Vi-mode indicator for zsh
2019-08-17 12:33:19 -07:00
John Letey 82cf484ced feat: Implement the prompt module for jobs (#85) 2019-08-12 13:42:33 -04:00
Kevin Song 3daf3ddf26 feat: implement timer module (#118)
Implement a timer module that takes a commandline argument, the number of seconds the last job took to complete, and displays it if appropriate.

Alters shell initialization files to compute this number using date +%s where needed.

Adds a config section to configure minimum amount of time before timer is shown (default is 2s)
2019-08-08 13:25:30 -04:00
Matan Kushner d7754f38e7
feat: Implement simplified prompt setup process (#90)
• Add starship init which prints the shell function used to execute starship
• Document the new setup process using starship init
• Remove benchmarks for now (WIP replacement benchmarks in "benchmarking" branch )
2019-07-03 08:03:02 -04:00
Matan Kushner 463ec26024
feat: Add a `disabled` configuration option for modules (#86)
• Add support for the disabled configuration option
This will allow you to selectively disable modules that you don't want or need. 😄
• Overwrite starship configuration file path with STARSHIP_CONFIG environment variable
• Write tests for the two configuration options that are available
2019-07-02 16:12:53 -04:00
Matan Kushner 097f1b05f1
Add support for prompt configuration (#62)
- Create `Config` struct that is added to `Context` when initialized
- Read `~/.confg/starship.toml` during initialization (can be updated later to also look at `$XDG_CONFIG_HOME`)
- `Context` now has a method for creating modules. This allows us to provide modules with a reference to the configuration specific to that module
2019-06-10 15:56:17 +01:00
Matan Kushner 8239fbd12b
Refactor integration tests (#71)
- Create subcommands to be able to print modules independently
	- `starship prompt` will print the full prompt
	- `starship module <MODULE_NAME>` will print a specific module
		e.g. `starship module python`
	- Added `--path` flag to print the prompt or modules without being in a specific directory
	- Added `--status` flag to provide the status of the last command, instead of requiring it as an argument
- Refactored integration tests to be end-to-end tests, since there was no way in integration tests to set the environment variables for a specific command, which was required for the `username` module
- Moved e2e tests to `tests/testsuite` to allow for a single binary to be built
	- Tests will build/run faster
	- No more false positives for unused functions
- Added tests for `username`
- Removed codecov + tarpaulin 😢
2019-06-06 13:18:00 +01:00
Matan Kushner 5b989fcb9c
feat: Add battery module(#63) 2019-05-22 12:29:39 -04:00
Matan Kushner 90d6e6cf0b
Implement the git status module (#45) 2019-05-13 22:43:11 -06:00
Matan Kushner c6ee5c6ac1
Refactor segments into modules (#40) 2019-05-01 16:34:24 -04:00
Matan Kushner 022e0002e4
Use "context" to contain run details (#14)
* Create "context" to contain run details

* Use context in tests and benchmarks
2019-04-19 16:57:14 -04:00
Matan Kushner 4ce4899f81
Add fish_prompt 2019-04-13 00:34:56 -04:00
Matan Kushner d82ebc4457
Add builder pattern for segment 2019-04-12 17:49:20 -04:00
Matan Kushner ab9ba27231
Revert "Parallelize nodejs file checks"
This reverts commit 99bdf27eca.
2019-04-12 13:10:31 -04:00
Matan Kushner 99bdf27eca
Parallelize nodejs file checks 2019-04-12 13:07:41 -04:00
Matan Kushner 969840a157
Tidy up dir section 2019-04-08 23:35:14 -04:00
Matan Kushner ff94c9f25f
Use git project root for truncation 2019-04-07 16:43:11 -04:00
Matan Kushner 472b66894d
Rename segements 2019-04-04 20:35:35 -04:00
Matan Kushner 168d568d54
Add line_sep section 2019-04-04 20:33:36 -04:00
Matan Kushner 52a529c627
Add basic benchmarks 2019-04-04 16:59:03 -04:00
Matan Kushner a81eabd690
Move Segment struct to modules 2019-04-04 12:18:05 -04:00
Matan Kushner e519c3f4a6
Set status with arg rather than env 2019-04-03 22:58:13 -04:00
Matan Kushner e2ba7a1354
Add segment structure and logic 2019-04-03 20:14:26 -04:00
Matan Kushner 41ee54933b
Start working on char color for status 2019-04-02 00:45:49 -04:00
Matan Kushner 4e1ae06622
Run rustfmt 2019-04-01 23:30:53 -04:00
Matan Kushner 106bcb73bc
Add authors to help message 2019-04-01 23:28:29 -04:00
Matan Kushner ca3f439012
Initial commit 2019-04-01 23:23:03 -04:00