Skip to content

Instantly share code, notes, and snippets.

@edgarjaviertec
Last active May 23, 2020 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edgarjaviertec/0aa34b3305f87cd5a020a9285643f443 to your computer and use it in GitHub Desktop.
Save edgarjaviertec/0aa34b3305f87cd5a020a9285643f443 to your computer and use it in GitHub Desktop.
Bash prompt personalizado para Windows 10

Bash prompt personalizado para Windows 10

Paso 1

Instalar Git para Windows https://gitforwindows.org/

Paso 2

Instalar Oh My Bash siguiendo las instrucciones de su README.md https://github.com/ohmybash/oh-my-bash

Paso 3

Copiar la carpeta 'luan' del siguiente directorio

%userprofile%\.oh-my-bash\custom\themes

Paso 4

Pegar la carpeta en el siguiente directorio

%userprofile%\.oh-my-bash\themes

Paso 5

Borrar el contenido del archivo y poner el siguiente contenido

#!/usr/bin/env bash

SCM_THEME_PROMPT_DIRTY=" ${red}"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}"
SCM_THEME_PROMPT_PREFIX="(${yellow}"
SCM_THEME_PROMPT_SUFFIX="${normal})"

GIT_THEME_PROMPT_PREFIX="${bold_blue}git:(${red}"
GIT_THEME_PROMPT_SUFFIX="${normal}"

GIT_THEME_PROMPT_DIRTY="${blue}) ${yellow}"
GIT_THEME_PROMPT_CLEAN="${blue}) ${bold_green}"

RVM_THEME_PROMPT_PREFIX=""
RVM_THEME_PROMPT_SUFFIX=""

function prompt_command() {
  current_dir="${cyan}\W${normal}"
  git_branch="$(scm_prompt_info)${normal}"
  prompt="${bold_green}\$${normal}"

  # ➜ icono sugerido

  if [[ $UID -eq "0" ]]
  then
    arrow="${bold_red}${normal}"
  else
    arrow="${bold_green}${normal}"
  fi

  PS1="$arrow ${current_dir} ${git_branch}"
}

safe_append_prompt_command prompt_command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment