Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
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`.
|
|
(#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.
|
|
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.)
|
|
session-key (#1755)
|
|
|
|
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.
|
|
|
|
|
|
* style: fix indent & spacing
* chore: use consistent function definition style
* chore: remove extra semicolon
* chore: flip comparison expression
|
|
|
|
|
|
This PR refactors config and puts configuration files for all modules in `configs/`.
|
|
Due to incompatibilities with the macOS date utility, we are
temporarily reverting this feature.
Refs: #c5e971a
|
|
|
|
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.
|