Skip to content

console lexer (BashSessionLexer) description lacks detail #1599

@j1elo

Description

@j1elo

After reporting an issue with the console lexer seemingly wrong behavior with single quotes in comment sections (#1598) it turns out the issue was just a matter of misuse.

I believe this is a documentation bug in the sense that the current description in the user docs ("Lexer for simplistic shell sessions", BashSessionLexer) is not even trying to convey the most basic concept of intended usage and explanation of the behavior.

Even something simple such as the example given in the other issue would already be a big improvement:

#1598 (comment)

the console lexer is meant for cases where you include shell prompt, command and output, e.g.

# ls -l
total 128
-rw-r--r-- 1 gbr gbr  8816 Oct 24 21:54 AUTHORS
-rw-r--r-- 1 gbr gbr 40808 Oct 24 21:54 CHANGES

The # at the start of a line here is recognized as a common prompt (for the root user), not as a comment sign.

If you're presenting pure shell code, you should use one of the shell lexers, usually bash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions