forked from starship/starship
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for elvish shell (starship#1725)
* feat: add support for elvish shell * improve doc * elvish 0.15 is out * fix example init * update systax for 0.15 stable * udpate second init example too * remove warning from swift module * add warning to status module docs * prefix elvish version with v
- Loading branch information
Showing
8 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
set-env STARSHIP_SHELL "elvish" | ||
set-env STARSHIP_SESSION_KEY (::STARSHIP:: session) | ||
|
||
# Define Hooks | ||
local:cmd-start-time = 0 | ||
local:cmd-end-time = 0 | ||
|
||
fn starship-after-readline-hook [line]{ | ||
cmd-start-time = (::STARSHIP:: time) | ||
} | ||
|
||
fn starship-before-readline-hook { | ||
cmd-end-time = (::STARSHIP:: time) | ||
} | ||
|
||
# Install Hooks | ||
edit:after-readline = [ $@edit:after-readline $starship-after-readline-hook~ ] | ||
edit:before-readline = [ $@edit:before-readline $starship-before-readline-hook~ ] | ||
|
||
# Install starship | ||
edit:prompt = { | ||
# Note: | ||
# Elvish does not appear to support exit status codes (--status) | ||
|
||
if (== $cmd-start-time 0) { | ||
::STARSHIP:: prompt --jobs=$num-bg-jobs | ||
} else { | ||
::STARSHIP:: prompt --jobs=$num-bg-jobs --cmd-duration=(- $cmd-end-time $cmd-start-time) | ||
} | ||
} | ||
|
||
# Get rid of default rprompt | ||
edit:rprompt = { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters