Exemple #1
0
 def enhance_colors_for_cmd_exe(self):
     """ Enhance colors when using cmd.exe on windows.
         When using the default style all blue and dark red colors
         are changed to CYAN and intense red.
     """
     env = builtins.__xonsh__.env
     # Ensure we are not using the new Windows Terminal, ConEmu or Visual Stuio Code
     if "WT_SESSION" in env or "CONEMUANSI" in env or "VSCODE_PID" in env:
         return
     if env.get("INTENSIFY_COLORS_ON_WIN", False):
         if win_ansi_support():
             newcolors = hardcode_colors_for_win10(self.styles)
         else:
             newcolors = intensify_colors_for_cmd_exe(self.styles)
         self.trap.update(newcolors)
Exemple #2
0
 def enhance_colors_for_cmd_exe(self):
     """ Enhance colors when using cmd.exe on windows.
         When using the default style all blue and dark red colors
         are changed to CYAN and intense red.
     """
     env = builtins.__xonsh__.env
     # Ensure we are not using ConEmu or Visual Stuio Code
     if "CONEMUANSI" in env or "VSCODE_PID" in env:
         return
     if env.get("INTENSIFY_COLORS_ON_WIN", False):
         if win_ansi_support():
             newcolors = hardcode_colors_for_win10(self.styles)
         else:
             newcolors = intensify_colors_for_cmd_exe(self.styles)
         self.trap.update(newcolors)
Exemple #3
0
def default_prompt():
    """Creates a new instance of the default prompt."""
    if xp.ON_CYGWIN or xp.ON_MSYS:
        dp = ("{env_name:{} }{BOLD_GREEN}{user}@{hostname}"
              "{BOLD_BLUE} {cwd} {prompt_end}{NO_COLOR} ")
    elif xp.ON_WINDOWS and not xp.win_ansi_support():
        dp = ("{env_name:{} }"
              "{BOLD_INTENSE_GREEN}{user}@{hostname}{BOLD_INTENSE_CYAN} "
              "{cwd}{branch_color}{curr_branch: {}}{NO_COLOR} "
              "{BOLD_INTENSE_CYAN}{prompt_end}{NO_COLOR} ")
    else:
        dp = ("{env_name:{} }"
              "{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} "
              "{cwd}{branch_color}{curr_branch: {}}{NO_COLOR} "
              "{BOLD_BLUE}{prompt_end}{NO_COLOR} ")
    return dp
Exemple #4
0
def default_prompt():
    """Creates a new instance of the default prompt."""
    if xp.ON_CYGWIN or xp.ON_MSYS:
        dp = ("{env_name}"
              "{BOLD_GREEN}{user}@{hostname}"
              "{BOLD_BLUE} {cwd} {prompt_end}{RESET} ")
    elif xp.ON_WINDOWS and not xp.win_ansi_support():
        dp = ("{env_name}"
              "{BOLD_INTENSE_GREEN}{user}@{hostname}{BOLD_INTENSE_CYAN} "
              "{cwd}{branch_color}{curr_branch: {}}{RESET} "
              "{BOLD_INTENSE_CYAN}{prompt_end}{RESET} ")
    else:
        dp = (
            "{env_name}"
            "{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} "
            "{cwd}{branch_color}{curr_branch: {}}{RESET} "
            "{RED}{last_return_code_if_nonzero:[{BOLD_INTENSE_RED}{}{RED}] }{RESET}"
            "{BOLD_BLUE}{prompt_end}{RESET} ")
    return dp
Exemple #5
0
def default_prompt():
    """Creates a new instance of the default prompt."""
    if xp.ON_CYGWIN or xp.ON_MSYS:
        dp = (
            "{env_name:{} }{BOLD_GREEN}{user}@{hostname}"
            "{BOLD_BLUE} {cwd} {prompt_end}{NO_COLOR} "
        )
    elif xp.ON_WINDOWS and not xp.win_ansi_support():
        dp = (
            "{env_name:{} }"
            "{BOLD_INTENSE_GREEN}{user}@{hostname}{BOLD_INTENSE_CYAN} "
            "{cwd}{branch_color}{curr_branch: {}}{NO_COLOR} "
            "{BOLD_INTENSE_CYAN}{prompt_end}{NO_COLOR} "
        )
    else:
        dp = (
            "{env_name:{} }"
            "{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} "
            "{cwd}{branch_color}{curr_branch: {}}{NO_COLOR} "
            "{BOLD_BLUE}{prompt_end}{NO_COLOR} "
        )
    return dp