summaryrefslogtreecommitdiffstats
path: root/src/init/starship.zsh
AgeCommit message (Collapse)Author
2021-05-12fix(zsh): preserve zle-keymap-select (#2717)Munif Tanjim
2021-04-29fix(zsh): Reverts changes to background jobs retaining improvements around ↵Felipe Seré
START_TIME (#2638) * Revert "fix(zsh): Set PROMPT just once (#2428)" This reverts commit 6fd7d7b5010c28d0557e4ff562187098abaa3bc6. * Reintroduce fixes around START_TIME * Bring back disabling virtualenv * Expand the jobstates before passing the number to starship Credit goes to @vladimyr
2021-03-15fix(zsh): Set PROMPT just once (#2428)Eric Nielsen
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-01-23perf: use built-in EPOCHREALTIME env-var to compute cmd_duration for ZSH5+ ↵Gautham Warrier
(#1751) We currently invoke `starship time` in a sub-shell to compute time, which is non-performant. By using $EPOCHREALTIME, which is an inbuilt env-var in ZSH5, we can get better performance. This commit only targets ZSH5+ and maintains the old behaviour.
2020-12-19feat(init): prefix STATUS and PREEXEC_READY shell vars with STARSHIP_ (#1710)Bjørn Forsman
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-11-07perf(init): use $RANDOM env-var instead of starship session to generate ↵Gautham Warrier
session-key (#1755)
2020-10-27fix(zsh): Ensure existing keymap change functions are not overriden (#1826)Gautham Warrier
2020-09-28feat: add error messaging (#1576)Tilmann Meyer
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-14fix(zsh): work when `setopt ksh_arrays` is set (#1612)David Knaack
2020-06-09fix: Retain previous command state on zsh keymap select (#958)Nemo157
2020-05-28style(init): tidy-up init scripts (#1269)Dario Vladović
* style: fix indent & spacing * chore: use consistent function definition style * chore: remove extra semicolon * chore: flip comparison expression
2019-12-19feat: cmd_duration module optionally reports milliseconds (#696)Luca Rinaldi
2019-10-04refactor: Go from Rust workspaces to a package with nested packages (#480)Matan Kushner
2019-09-30refactor: Refactoring config (#383)Zhenhui Xie
This PR refactors config and puts configuration files for all modules in `configs/`.
2019-09-25revert: Revert the command duration in ms feature (#380) (#425)Matan Kushner
Due to incompatibilities with the macOS date utility, we are temporarily reverting this feature. Refs: #c5e971a
2019-09-24feat: Add ability for command duration in milliseconds (#380)Tom Hotston
2019-09-10refactor: Separate shell initialization into files (#338)Kevin Song
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.