why BashSessionLexer don't know (many linux's) standard PS1 "[user@host ~]$" as Generic.Prompt?

Issue #1117 resolved
Hiroaki Itoh created an issue

Regarding to https://bitbucket.org/birkenfeld/pygments-main/pull-request/479/add-msdossessionlexer-and/diff, I noticed _ps1rgx for BashSessionLexer is strange.

Currently, BashSessionLexer know

[user@host ~]:$

is a Generic.Prompt, but don't know

[user@host ~]$

is a Generic.Prompt.

In other words, why following regexp

\[\S+[@:][^\n]+\].+[$#%]

is not

\[\S+[@:][^\n]+\].*[$#%]

?

See also http://pygments.org/demo/1990467/

Comments (3)

  1. Log in to comment