feat: Add support for RPROMPT (right prompt) (#3026)

Adds support for zsh, fish, and elvish.

Co-authored-by: Matan Kushner <hello@matchai.dev>
This commit is contained in:
Matthew (Matt) Jeffryes
2021-09-08 12:45:27 -07:00
committed by GitHub
parent cb8dca2101
commit 79585dcb17
11 changed files with 180 additions and 37 deletions
+6
View File
@@ -46,6 +46,9 @@ pub struct Context<'a> {
/// The shell the user is assumed to be running
pub shell: Shell,
/// Construct the right prompt instead of the left prompt
pub right: bool,
/// A HashMap of environment variable mocks
#[cfg(test)]
pub env: HashMap<&'a str, String>,
@@ -120,6 +123,8 @@ impl<'a> Context<'a> {
let cmd_timeout = Duration::from_millis(config.get_root_config().command_timeout);
let right = arguments.is_present("right");
Context {
config,
properties,
@@ -129,6 +134,7 @@ impl<'a> Context<'a> {
dir_contents: OnceCell::new(),
repo: OnceCell::new(),
shell,
right,
#[cfg(test)]
env: HashMap::new(),
#[cfg(test)]