Repository navigation
Configurable built-in prompts - #2064
Merged
Merged
Conversation
fdncred
reviewed
Jun 27, 2020
| } | ||
|
|
||
| fn signature(&self) -> Signature { | ||
| Signature::build("with-env") |
Contributor
There was a problem hiding this comment.
Is this signature right? Just seems odd to have with-env in the midst of do
This was referenced Jun 28, 2020
Closed
|
@jntrnr any up to date example how to set it? The documentation is missing and the example you have provided does not work anymore as there have been some breaking changes. I am trying simple things like: etc. but none seems to work. I always get |
Contributor
|
@m-kru string interpolation changed a few releases ago. Try something like |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PR adds a few features that work together to allow you to configure your built-in prompt by setting the
promptconfig setting. This will point to a pipeline that runs and creates the prompt. This works similarly to thestartup, with a focus of running a single pipeline to create the prompt.To help create prompts, we have a few new commands:
ansi- which creates ANSI color codes. For exampleansi bluewill return the ansi color code to change the font bluedo- which runs the block given to completion, optionally ignoring errorsAnother update to help was to add sterr redirection. We will now redirect stderr if part of the pipeline, turning the text into error values which are sent to commands later in the pipeline.
Here's an example prompt that shows the
pwdand the current git branch, each given a separate color. It also ignores any error if the git branch is missing: