-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prompt: Color of the git branch #187
Comments
Here is how to achieve the green color: --- a/crates/shell/src/main.rs
+++ b/crates/shell/src/main.rs
@@ -115,7 +115,7 @@ async fn interactive(state: Option<ShellState>, norc: bool) -> miette::Result<()
};
let prompt = format!("{}{git_branch}$ ", display_cwd);
- let color_prompt = format!("\x1b[34m{}\x1b[31m{git_branch}\x1b[0m$ ", display_cwd);
+ let color_prompt = format!("\x1b[34m{}\x1b[32m{git_branch}\x1b[0m$ ", display_cwd);
rl.helper_mut().unwrap().colored_prompt = color_prompt;
rl.readline(&prompt)
}; |
certik
added a commit
to certik/shell
that referenced
this issue
Jan 20, 2025
This agrees with the default prompt in `zsh` on macOS, and it seems less distracting than the red color, which seems to suggest some error state. Towards prefix-dev#187.
prsabahrami
pushed a commit
that referenced
this issue
Jan 20, 2025
This agrees with the default prompt in `zsh` on macOS, and it seems less distracting than the red color, which seems to suggest some error state. Towards #187.
I opened up #200 for the general solution to this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I used to use red color for years. But the default on macOS seems to be green:
The first is
shell
, the second iszsh
. I actually kind of like the green color. So I wonder if we should use it by default.We need to enable configuring the prompt, so that users can set it up any way they like.
The text was updated successfully, but these errors were encountered: