Commit Graph

29 Commits

Author SHA1 Message Date
Ariel Barreiro 8168c21293
fix(bash): unbound variable error with STARSHIP_PREEXEC_READY (#5438)
Prevent unbound variable error
2023-10-01 08:54:06 +02:00
Ajeet D'Souza 0a05b5ca8b
fix(bash): Clear out completed jobs before counting NUM_JOBS (#5253)
Clear out completed jobs before counting NUM_JOBS
2023-06-17 14:06:35 +02:00
Kian-Meng Ang 018b077630
chore: fix typos in comments (#4122) 2022-06-28 14:19:17 -04:00
David Knaack 03343272b7
fix(bash): ensure `checkwinsize` is enabled for `$COLUMNS` (#3832) 2022-04-03 15:07:19 -04:00
Kevin Song 6e24358052
fix(bash): Restore previous exit status in bash init (#3521)
* fix: Restore previous exit status in bash init

* Do it correctly this time
2022-01-30 10:52:51 +01:00
Ryan Cohen 4deaa02d6f
feat: set a continuation prompt for supporting shells (#3322)
* feat: set a continuation prompt for supporting shells (#3134)

* docs: fixed wording of documentation

* fix: continuation prompt is now only set once

* fix(docs): fixed typo in advanced-config/README.md

Co-authored-by: Segev Finer <segev208@gmail.com>

* fix: update --continuation argument

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

* fix: updated continuation prompt

- PROMPT2 was fixed to be set only once in zsh.
- `continuation_symbol` and `continuation_format` were removed in
  place of a single variable; `continuation_prompt`.
- The continuation prompt was moved out of the character module.

* fix: ran rustfmt

* docs: updated continuation prompt docs

Co-authored-by: Segev Finer <segev208@gmail.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
2022-01-01 14:12:11 +01:00
Rashil Gandhi 6464693165
fix(fill): Add `terminal-width` argument to explicitly define terminal's width (#3090)
Add `terminal-width` argument to explicitly define terminal's width
Update pwsh,bash,zsh,fish init scripts with `terminal-width` argument

Co-authored-by: Kevin Song <chips@ksong.dev>
Co-authored-by: Kevin Song <4605384+chipbuster@users.noreply.github.com>
2021-10-06 16:36:28 -05:00
Kevin Song 190743e4e0
fix: pipestatus quoting on Zsh/Bash (#3088)
Changes the parsing for pipestatus to allow for multiple arguments, a
single argument of space-separated values, or any mix of the two. All
inputs are flattened into a single array where no elements have spaces
in them.

Changes the initscripts to no longer fail when an empty pipestatus
is passed as an argument by quoting and changing expansions.
2021-10-05 18:19:55 -05:00
Hugues Morisset 40cb667b9d
feat(status): Add pipestatus display in status module (#2481)
* feat: Add pipestatus display in status module

This MR is based on this one https://github.com/starship/starship/pull/370

* Documentation

* Add a test with map_symbol false

* Handle bash preexec pipestatus

* Add zsh support

* Add fish support

Thanks kidonng for the diff patch

* Rename sucess_symbol to success_symbol
2021-07-28 12:26:00 -04:00
Rich Lafferty 3127a9aa87
fix(bash): Count jobs with for loop to fix MacOS count issue (#2250)
In #1897 we replaced a 'wc -l' with a bash-native job counter, but
subsequently discovered that bash on MacOS folds '<<<' output into
a single line, preventing line counting.

A for loop works around that problem, is still bash-native, and works
on Linux as well.

While we're at it, also removed the need for command substitution and
an echo by doing the work directly on NUM_JOBS.

Fixes #2241.
2021-01-31 22:56:06 +01:00
Thomas O'Donnell 8cd4850ab6
fix(bash): Fix broken bash init script (#2100)
This fixes a regression where the exit code of the most recently run
command was not correctly recorded in the bash init script.
2021-01-07 18:35:32 +01:00
Kevin Song 55c3cafd94
fix(bash): bash-preexec detection and implementation (#2091)
* Fix bash-preexec detection and implementation

* Add detection for other arrays
2021-01-07 18:15:43 +01:00
Bjørn Forsman f17556d389
feat(init): prefix STATUS and PREEXEC_READY shell vars with STARSHIP_ (#1710)
I was surprised to see these (unprefixed) variables being set in my
shell. I think it's better to have them in the STARSHIP_ "namespace".
(Actually, STATUS got the new name STARSHIP_CMD_STATUS.)
2020-12-19 12:04:15 +01:00
Kevin Song 0d3b2aaf12
style: Add comments for bash preexec fix (#1952)
* Add comments for bash fix

* Rewrite commend
2020-12-02 08:48:13 +01:00
Harald Hoyer f873a9820e
fix(bash): Fix background jobs with z/autojump (#1897)
Fixes issue where having z.sh or autojump hooked in bash
would cause spurious background job indicators to appear.
2020-12-02 00:29:02 -06:00
Gautham Warrier 7450510327
perf(init): use $RANDOM env-var instead of starship session to generate session-key (#1755) 2020-11-07 16:30:08 +01: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
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
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
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
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
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
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
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
Matan Kushner caaf3bc6a9
revert: Revert the command duration in ms feature (#380) (#425)
Due to incompatibilities with the macOS date utility, we are
temporarily reverting this feature.

Refs: #c5e971a
2019-09-25 17:13:58 +09:00
Tom Hotston c5e971aef8 feat: Add ability for command duration in milliseconds (#380) 2019-09-24 14:03:10 -05:00
Kevin Song 54793c7d5a refactor: Separate shell initialization into files (#338)
Shell inits are now in a separate directory in the source code, with each shell getting its own script. Also adds a little DRY + commenting in init/mod.rs.
2019-09-10 20:31:08 -04:00