diff options
Diffstat (limited to 'pygments/lexers/postgres.py')
-rw-r--r-- | pygments/lexers/postgres.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pygments/lexers/postgres.py b/pygments/lexers/postgres.py index 92c8833c..1bb38556 100644 --- a/pygments/lexers/postgres.py +++ b/pygments/lexers/postgres.py @@ -186,6 +186,14 @@ class PostgresConsoleLexer(Lexer): # the repl loop will be broken below break + # Identify a shell prompt in case of psql commandline example + if line.startswith('$'): + lexer = get_lexer_by_name('console', **self.options) + for x in lexer.get_tokens_unprocessed(line): + yield x + break + + # Identify a psql prompt mprompt = re_prompt.match(line) if mprompt is not None: insertions.append((len(curcode), |