Skip to content

Instantly share code, notes, and snippets.

@axani
Last active July 9, 2022 05:41
Show Gist options
  • Save axani/d62659abad15fb168e4e to your computer and use it in GitHub Desktop.
Save axani/d62659abad15fb168e4e to your computer and use it in GitHub Desktop.
iTerm2 Triggers for Python

About

You can colorize Python messages in iTerm by adding triggers to your profile.

Go to

iTerm > Settings > Profiles > Triggers > Edit

Triggers

Highlight Text - Traceback calls:
Traceback([\s\S]*)

Highlight Text - line and number:
line [\d]*

Highlight Text - errors:

(BaseException|Exception|StandardError|ArithmeticError|BufferError|LookupError|EnvironmentError|AssertionError|AttributeError|EOFError|FloatingPointError|GeneratorExit|IOError|ImportError|IndexError|KeyError|KeyboardInterrupt|MemoryError|NameError|NotImplementedError|OSError|OverflowError|ReferenceError|RuntimeError|StopIteration|SyntaxError|IndentationError|TabError|SystemError|SystemExit|TypeError|UnboundLocalError|UnicodeError|UnicodeEncodeError|UnicodeDecodeError|UnicodeTranslateError|ValueError|VMSError|WindowsError|ZeroDivisionError|Warning|UserWarning|DeprecationWarning|PendingDeprecationWarning|SyntaxWarning|RuntimeWarning|FutureWarning|ImportWarning|UnicodeWarning)(.*)

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