Add support for more complex command prompts #583
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The bashsession lexer did only recognize command prompts starting with
one of the characters
#$%>
. This commit adds support for a prefixedblock of the form
[.*]
, which is a common layout for command prompts.The highlighting could accidentally trigger on text starting with something like
[+] $
but I guess this is okay. To make it more restrictive, one could also thing about removing the spaces between the last closing bracket and the special prompt character#$%>
. If this is desired, I could change it.Furthermore, one could also think about changing the highlighting of the command output. The current highlighting for the command output is
GenericOutput
, which seems to leave the output just in ordinary text color. This makes it hard to distinguish from surrounding text. Maybe it would be better to choose a dedicated highlighting for that, as it is done by GitHub:However, I'm not familiar with your default styles and themes and not sure which highlighting option would be the best. If you have a suggestion, just mention it and I will add it to this PR :)
Best regards,
Tobias