1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-25 11:20:01 +00:00

fix: Set default prompt character to ❯ (#177)

This commit is contained in:
Kevin Song 2019-08-18 08:34:45 -07:00 committed by Matan Kushner
parent 572a07c72d
commit 85ac0a6801
3 changed files with 10 additions and 10 deletions

View File

@ -17,9 +17,9 @@ All configuration for starship is done in this [TOML](https://github.com/toml-la
# Don't print a new line at the start of the prompt
add_newline = false
# Replace the "➜" symbol in the prompt with ""
# Replace the "" symbol in the prompt with "➜"
[character] # The name of the module we are confguring is "character"
symbol = "" # The "symbol" segment is being set to ""
symbol = "➜" # The "symbol" segment is being set to "➜"
# Disable the package module, hiding it from the prompt completely
[package]
@ -91,13 +91,13 @@ is entered in your terminal.
The character will tell you whether the last command was successful or not. It
can do this in two ways: by changing color (red/green) or by changing its shape
(/✖). The latter will only be done if `use_symbol_for_status` is set to `true`.
(/✖). The latter will only be done if `use_symbol_for_status` is set to `true`.
### Options
| Variable | Default | Description |
| ----------------------- | ------- | --------------------------------------------------------------------------------- |
| `symbol` | `""` | The symbol used before the text input in the prompt. |
| `symbol` | `""` | The symbol used before the text input in the prompt. |
| `error_symbol` | `"✖"` | The symbol used before text input if the previous command failed. |
| `use_symbol_for_status` | `false` | Indicate error status by changing the symbol. |
| `vicmd_symbol` | `""` | The symbol used before the text input in the prompt if zsh is in vim normal mode. |
@ -109,7 +109,7 @@ can do this in two ways: by changing color (red/green) or by changing its shape
# ~/.config/starship.toml
[character]
symbol = ""
symbol = ""
error_symbol = "✗"
use_symbol_for_status = true
```

View File

@ -10,7 +10,7 @@ use ansi_term::Color;
/// - If the exit-code was anything else, the arrow will be formatted with
/// `COLOR_FAILURE` (red by default)
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
const SUCCESS_CHAR: &str = "";
const SUCCESS_CHAR: &str = "";
const FAILURE_CHAR: &str = "";
const VICMD_CHAR: &str = "";

View File

@ -5,7 +5,7 @@ use crate::common::{self, TestCommand};
#[test]
fn char_module_success_status() -> io::Result<()> {
let expected = format!("{} ", Color::Green.bold().paint(""));
let expected = format!("{} ", Color::Green.bold().paint(""));
// Status code 0
let output = common::render_module("character")
@ -24,7 +24,7 @@ fn char_module_success_status() -> io::Result<()> {
#[test]
fn char_module_failure_status() -> io::Result<()> {
let expected = format!("{} ", Color::Red.bold().paint(""));
let expected = format!("{} ", Color::Red.bold().paint(""));
let exit_values = ["1", "54321", "-5000"];
@ -41,7 +41,7 @@ fn char_module_failure_status() -> io::Result<()> {
#[test]
fn char_module_symbolyes_status() -> io::Result<()> {
let expected_fail = format!("{} ", Color::Red.bold().paint(""));
let expected_success = format!("{} ", Color::Green.bold().paint(""));
let expected_success = format!("{} ", Color::Green.bold().paint(""));
let exit_values = ["1", "54321", "-5000"];
@ -77,7 +77,7 @@ fn char_module_symbolyes_status() -> io::Result<()> {
fn char_module_vicmd_keymap() -> io::Result<()> {
let expected_vicmd = format!("{} ", Color::Green.bold().paint(""));
let expected_specified = format!("{} ", Color::Green.bold().paint("N"));
let expected_other = format!("{} ", Color::Green.bold().paint(""));
let expected_other = format!("{} ", Color::Green.bold().paint(""));
// zle keymap is vicmd
let output = common::render_module("character")