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

53 Commits

Author SHA1 Message Date
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
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
Dan Wendorf
dee25c7b35 feat: Add prefix config to directory module (#642) 2019-12-06 14:19:11 -05:00
Raidou
2a75a18eb1 fix: Fix panic when using fish-style pwd with unicode symbols (#672) 2019-11-29 00:02:22 -05: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
Clément Joly
7e21f5c6b6 Refactor: Remove unnecessary parentheses in if condition (#566) 2019-10-20 17:36:02 +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
Keith Wade
10efe3e320 fix: Show leading slash when truncating from root (#526) 2019-10-15 00:12:43 +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
yuri
63a45d01f9 feat: Use tilde for home_directory when under version control (#439) 2019-09-28 22:50:38 -05:00
Kevin Song
c2875d99b6 feat: add support for logical paths in directory (#366)
Adds the ability for starship to display the logical path instead of the physical path.
2019-09-20 12:28:09 -04:00
Neil Kistner
cd892ebb60 fix: fish_pwd option handles repeated directories properly (#399) 2019-09-20 10:37:55 -04: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
Neil Kistner
e034253a5e feat: Add ability to use an alternate directory truncation style (#239)
* Add ability to use an alternate directory truncation style
2019-08-26 21:52:45 -04:00
Saghm Rossi
84c394e7b0 feat: Add option to control git directory truncation (#165) 2019-08-16 20:29:22 -07:00
Saghm Rossi
5ad07bf2d9 docs: Fix typo in directory module description (#163) 2019-08-16 14:16:29 -04:00
Matan Kushner
f40f73dc8e fix: Address longstanding linter errors 2019-08-05 11:05:08 -04:00
Andrew Dassonville
5dbf4381ac feat: Allow directory truncation length to be configured (#120)
This allows the directory truncation length to be configured. Previously, it was hard-coded to truncate to 3 parent directories.
2019-07-28 21:05:13 -04:00
Andrew Dassonville
75e74e0d74 feat: Use Unix-style slash on Windows (#119)
Prior to this change, starship would use inconsistent slashes when displaying the working directory. With this change, starship uses Unix-style slashes on all platforms. This is consistent with the Git Bash and Cygwin prompts on Windows.
2019-07-28 20:15:40 -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
0703a74048
ci: Add GitHub releases to CI (#95) 2019-07-14 17:54:45 -04:00
Matan Kushner
77ba97df19
chore: Refactor getting string values from config (#94) 2019-07-14 11:15:47 -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
Youssef Habri
08b238114e feat: Implement the prompt module for username (#56) 2019-05-19 22:26:12 -04:00
Matan Kushner
2cf69a82b7
ci: Fix CI to work with changes to Azure Pipelines build agent (#55) 2019-05-16 09:40:30 -06:00
Matan Kushner
8b5055d510
Parallelize prompt modules (#46) 2019-05-09 23:51:50 -04:00
Matan Kushner
c6ee5c6ac1
Refactor segments into modules (#40) 2019-05-01 16:34:24 -04:00
Matan Kushner
9a352c0acc
Add the Git branch segment (#32)
Added
- Repository to Context for reuse in directory and git_branch
- git_branch to prompt

Changed
- Made segments bold to match spaceship
2019-04-26 22:07:07 -04:00
Matan Kushner
bb2bcd604b
Share dir_files between segments through Context (#16) 2019-04-23 14:51:08 -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
ab5490bea6
Add README.md badges (#5) 2019-04-15 14:38:45 -04:00
Matan Kushner
d2cda32c87
Better test and document the dir segment 2019-04-15 12:04:53 -04:00
Matan Kushner
bca4a7079f
Fix bug in path truncation
Paths with 3 components would truncate to 2 despite the truncation length begin set to 3.
2019-04-15 11:40:40 -04:00
Matan Kushner
9d4492c313
Make segments optionals 2019-04-12 23:06:48 -04:00
Matan Kushner
d62bb107f2
Remove unnecessary lifetimes 2019-04-12 19:18:47 -04:00
Matan Kushner
a0e4172602
Use copy to return segment 2019-04-12 19:11:40 -04:00
Matan Kushner
c1f5a733c9
More progress in Node section 2019-04-11 19:31:30 -04:00
Matan Kushner
d5493d236d
Begin writing Node section 2019-04-10 09:22:11 -04:00
Matan Kushner
67ab2121c5
Add note and test regarding paths being physical 2019-04-09 00:04:50 -04:00
Matan Kushner
969840a157
Tidy up dir section 2019-04-08 23:35:14 -04:00
Matan Kushner
d58ea0659b
Add a new line before the prompt 2019-04-08 17:35:38 -04:00
Matan Kushner
0e0bed0837
Use truncate_path to simplify dir 2019-04-08 15:33:06 -04:00
Matan Kushner
5086ba2f50
A bit of tidying up 2019-04-07 23:28:38 -04:00
Matan Kushner
168a6fd7b1
Add proper git project root truncation 2019-04-07 23:23:37 -04:00
Matan Kushner
3c07e284fe
Add some clarifying documentation 2019-04-07 17:17:40 -04:00
Matan Kushner
fdacd1cf28
Readd home dir truncation 2019-04-07 17:12:22 -04:00