diff options
author | Rashil Gandhi <46838874+rashil2000@users.noreply.github.com> | 2022-09-09 18:26:33 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 14:56:33 +0200 |
commit | 06281c268d74a85d5b28e953bea251a2115f5568 (patch) | |
tree | 1eafa292832c50cbe695096c4b498464a171c271 /docs/advanced-config | |
parent | fd5539796f7a2b3750d1889b55a563d84b628bee (diff) |
feat(fish): Enable left and right transience (#4204)
* feat(fish): Enable left and right transience
* Update README.md
* Mention limitation
Diffstat (limited to 'docs/advanced-config')
-rw-r--r-- | docs/advanced-config/README.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/advanced-config/README.md b/docs/advanced-config/README.md index e030cadf3..9718e94d9 100644 --- a/docs/advanced-config/README.md +++ b/docs/advanced-config/README.md @@ -71,6 +71,41 @@ end load(io.popen('starship init cmd'):read("*a"))() ``` +## TransientPrompt and TransientRightPrompt in Fish + +It is possible to replace the previous-printed prompt with a custom string. This +is useful in cases where all the prompt information is not always needed. To enable +this, run `enable_transience` in the shell session. To make it permanent, put +this statement in your `~/.config/fish/config.fish`. Transience can be disabled on-the-fly with +`disable_transience`. + +Note that in case of Fish, the transient prompt is only printed if the commandline is non-empty, +and syntactically correct. + +- By default, the left side of input gets replaced with a bold-green `❯`. To customize this, + define a new function called `starship_transient_prompt_func`. For example, to + display Starship's `character` module here, you would do + +```fish +function starship_transient_prompt_func + starship module character +end +starship init fish | source +enable_transience +``` + +- By default, the right side of input is empty. To customize this, define a new + function called `starship_transient_rprompt_func`. For example, to display + the time at which the last command was started here, you would do + +```fish +function starship_transient_rprompt_func + starship module time +end +starship init fish | source +enable_transience +``` + ## Custom pre-prompt and pre-execution Commands in Cmd Clink provides extremely flexible APIs to run pre-prompt and pre-exec commands |