Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console lexer (BashSessionLexer) description lacks detail #1599

Closed
j1elo opened this issue Nov 11, 2020 · 3 comments
Closed

console lexer (BashSessionLexer) description lacks detail #1599

j1elo opened this issue Nov 11, 2020 · 3 comments
Milestone

Comments

@j1elo
Copy link

j1elo commented Nov 11, 2020

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.

@birkenfeld
Copy link
Member

Thanks, this is a very good point.

@Anteru Anteru added the changelog-update Items which need to get mentioned in the changelog label Nov 11, 2020
@Anteru Anteru added this to the 2.7.3 milestone Nov 11, 2020
@j1elo
Copy link
Author

j1elo commented Nov 11, 2020

Quite terse, but already much better than before. Thanks!

@Anteru Anteru removed the changelog-update Items which need to get mentioned in the changelog label Dec 5, 2020
@pspacek
Copy link

pspacek commented Apr 5, 2022

I guess someone in future might appreciate an example, so here is one generated using Sphinx:

  • Bash
    code-block-bash

  • Console
    code-block-console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants