Lexer for cmd.exe interactive session with Python venvs

Issue #1380 new
Miro Hrončok
created an issue

Consider the following code:

$ mkdir project
$ cd project
$ python3.6 -m venv __venv__ 
$ . __venv__/bin/activate
(__venv__)$ python -m pip install pygments
(__venv__)$ ...
(__venv__)$ deactivate

(console lexer)

The $ and later the (__venv__)$ is recognized as prompt. That's correct.

Now consider replacing $ with >:

> mkdir project
> cd project
> py -3 -m venv __venv__
> __venv__\Scripts\activate
(__venv__)> python -m pip install pygments
(__venv__)> ...
(__venv__)> deactivate

(console lexer)

Now > is recognized as prompt, but the line starting with (__venv__)> are recognized as generic output (class go).

Now of course the second example is Windows. And console is BashSessionLexer and Windows is no Bash, so I'm abusing the lexer here. But what other lexer to try?

> mkdir project
> cd project
> py -3 -m venv __venv__
> __venv__\Scripts\activate
(__venv__)> python -m pip install pygments
(__venv__)> ...
(__venv__)> deactivate

(doscon lexer), not good (works for (__venv__)>, but not for plain >)


> mkdir project
> cd project
> py -3 -m venv __venv__
> __venv__\Scripts\activate
(__venv__)> python -m pip install pygments
(__venv__)> ...
(__venv__)> deactivate

(bat lexer), not good (it's for bat files, not interactive console session)


> mkdir project
> cd project
> py -3 -m venv __venv__
> __venv__\Scripts\activate
(__venv__)> python -m pip install pygments
(__venv__)> ...
(__venv__)> deactivate

(ps1con lexer), not good, doesn't recognize > as prompt


Maybe this is a bug in the doscon lexer? Thanks for help.