You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
591 B
28 lines
591 B
3 years ago
|
package b
|
||
|
|
||
|
import (
|
||
|
. "github.com/alecthomas/chroma" // nolint
|
||
|
"github.com/alecthomas/chroma/lexers/internal"
|
||
|
)
|
||
|
|
||
|
// BashSession lexer.
|
||
|
var BashSession = internal.Register(MustNewLazyLexer(
|
||
|
&Config{
|
||
|
Name: "BashSession",
|
||
|
Aliases: []string{"bash-session", "console", "shell-session"},
|
||
|
Filenames: []string{".sh-session"},
|
||
|
MimeTypes: []string{"text/x-sh"},
|
||
|
EnsureNL: true,
|
||
|
},
|
||
|
bashsessionRules,
|
||
|
))
|
||
|
|
||
|
func bashsessionRules() Rules {
|
||
|
return Rules{
|
||
|
"root": {
|
||
|
{`(^[#$%>]\s*)(.*\n?)`, ByGroups(GenericPrompt, Using(Bash)), nil},
|
||
|
{`^.+\n?`, GenericOutput, nil},
|
||
|
},
|
||
|
}
|
||
|
}
|