1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-26 03:32:36 +00:00
Commit Graph

35 Commits

Author SHA1 Message Date
David Knaack
0fd6f05da4
fix(properties): fix regressions in status, pipestatus and terminal-width handling (#3399) 2022-01-15 04:21:38 -05:00
Rashil Gandhi
c335b4267b
feat: add support for cmd (#3277)
* feat: add support for cmd

* add preprompt and precmd support

* add keymap support

* add info about minimum Clink version

* simplify escaping

* add handling for cmd custom commands

* add support for transient_prompt and transient_rprompt

* Revert 914057952508e81e20086fcb707ba2a0be85fdd3

This reverts commit "add support for transient_prompt and transient_rprompt"

* Apply suggestions from code review

* disable cmd shell custom commands

* any shell other than cmd can be used

* better error and correct script location

* move shell check in `map_no_escaping`
2022-01-09 23:47:53 -06:00
David Knaack
20cf200c3a
refactor: update clap to v3 (#3370) 2022-01-04 12:49:42 +03:00
Fred Cox
c1f2d345aa
fix(escaping): move escaping to individual variables (#3107) 2021-11-01 22:18:45 +01:00
David Knaack
af43aeefba
fix(clippy): fix new clippy lints (#2939) 2021-07-29 14:27:46 -04:00
Dario Vladović
67e0eb0e9a
refactor: read CLI options as str (#2656) 2021-04-28 20:39:32 +02:00
David Knaack
04d1332f9c
refactor(clippy): fix new lints (#2297) 2021-02-11 21:08:17 +01:00
Hanif Ariffin
5722b17f9e
fix: Applied clippy warnings (#2153)
* Applied changes suggested by clippy

In general:

1. Prefer std::path::Path over std::path::PathBuf
2. Simplified code with string formating...

Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>

* Fixed test

Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>

* Fixed formatting

Signed-off-by: Hanif Ariffin <hanif.ariffin.4326@gmail.com>
2021-01-16 13:26:52 +01:00
Tilmann Meyer
88b603be38
test: introduce env variable mocking (#1490) 2020-08-07 15:13:12 -04:00
Zhenhui Xie
ec76fafff0
feat: refactor modules to use format strings (#1374) 2020-07-07 18:45:32 -04: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
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
044e10de1b chore: Import shared types from super (#492)
Changes imports statements to make imports more uniform.
2019-10-05 16:13:03 -05: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
Neil Kistner
9f70ffb7a7 fix: Lazy load git repo and only run module if not disabled (#306)
A couple of optimizations are done in this PR. One, we now will check config ahead of time to see if a module is disabled before running any module code. Also, we won't try to discover a git repository unless the module requests access to it.
2019-09-09 19:14:38 -04:00
Kevin Song
9721666d33
feat: Add the ability to configure per-module color styles (#285)
Add parsing logic, config support, docs, and integration with other modules 
for custom styling of each module.
2019-09-07 19:33:06 -05:00
Quinn Strahl
3dd035056d Support vicmd_symbol in fish-shell (#254) 2019-08-31 00:59:18 -07:00
Kevin Song
85ac0a6801 fix: Set default prompt character to ❯ (#177) 2019-08-18 11:34:45 -04: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
Kevin Song
39598ec691 feat: Add configuration to change the character for non-zero sta… (#133)
Prompt can now switch characters in addition to switching character color. Add configuration options in so that users can do either, both, or neither.
2019-08-10 17:30:30 -04:00
Tiffany Le-Nguyen
08cf33522a docs: Add vuepress with initial docs (#99)
Co-authored-by: Tiffany Le-Nguyen <tlenguyen@expedia.com>
Co-authored-by: Matan Kushner <hello@matchai.me>
2019-07-19 16:18:52 -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
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
794ae7b2ad
Add integration tests (#6)
### Changed
- Added current_dir param to segments to make them more testable
- Moved all existing integration tests to a `tests/` dir

### Added
- A whole bunch of new integration tests
2019-04-15 20:54:52 -04:00
Matan Kushner
9d4492c313
Make segments optionals 2019-04-12 23:06:48 -04:00
Matan Kushner
a0e4172602
Use copy to return segment 2019-04-12 19:11:40 -04:00
Matan Kushner
fec5c4db4e
Use builder pattern in char section 2019-04-12 18:12:29 -04:00
Matan Kushner
d82ebc4457
Add builder pattern for segment 2019-04-12 17:49:20 -04:00
Matan Kushner
d5493d236d
Begin writing Node section 2019-04-10 09:22:11 -04:00
Matan Kushner
5086ba2f50
A bit of tidying up 2019-04-07 23:28:38 -04:00
Matan Kushner
c79cbe63b1
Add stringify_segment rustdoc 2019-04-04 21:35:24 -04:00