Color Your Shell Prompt Red If the Last Command Threw an Error

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024

Комментарии • 4

  • @ssd6010
    @ssd6010 8 месяцев назад +1

    Nice video!!

  • @wChris_
    @wChris_ 8 месяцев назад

    you should be careful when using non printing characters an a bash prompt as that causes weird issues when writing commands that are longer than 1 line. Also you should use \$ as that will become # if the euid is 0 and $ else. see 'PROMPTING' in bash manual.

    • @NickJanetakis
      @NickJanetakis  8 месяцев назад

      Right, you mean using characters that you'd normally access with ALT + number combos like ° , fortunately $ will have no issues.

    • @wChris_
      @wChris_ 8 месяцев назад

      @@NickJanetakis I mean the escape sequences for coloring. like '[01;31m' while its part of an escape sequence those characters are still counted towards the total line length.