diff --git a/pwncat/lexer.py b/pwncat/lexer.py index d6cd45d..f515a32 100644 --- a/pwncat/lexer.py +++ b/pwncat/lexer.py @@ -2,8 +2,15 @@ from pygments.lexer import RegexLexer, bygroups, include from pygments.token import * +from pygments.style import Style +from prompt_toolkit.styles.pygments import style_from_pygments_cls +from pygments.styles import get_style_by_name + +PwncatStyle = style_from_pygments_cls(get_style_by_name("monokai")) + class LocalCommandLexer(RegexLexer): + tokens = { "root": [ (r"download", Name.Function), diff --git a/pwncat/pty.py b/pwncat/pty.py index edb0c52..274f031 100644 --- a/pwncat/pty.py +++ b/pwncat/pty.py @@ -27,8 +27,9 @@ import os from pwncat import util from pwncat import downloader, uploader, privesc -from pwncat.lexer import LocalCommandLexer from pwncat.file import RemoteBinaryPipe +from pwncat.lexer import LocalCommandLexer, PwncatStyle + from colorama import Fore @@ -360,6 +361,7 @@ class PtyHandler: completer=CommandCompleter(completer_graph), auto_suggest=AutoSuggestFromHistory(), lexer=PygmentsLexer(LocalCommandLexer), + style=PwncatStyle, ) def which(self, name: str, request=True) -> str: