pygments-shell-console 0.3__tar.gz → 0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/PKG-INFO +1 -1
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/pyproject.toml +1 -1
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/shellconsole_lexer.py +1 -1
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_prompts.py +14 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/.github/workflows/publish-to-pypi.yml +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/.gitignore +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/README.md +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/git_lg.example +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/git_log.example +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/git_show.example +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/status.example +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/test.exmpl +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/test.sh +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/git_lexer.py +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/shellconsole_style.py +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/__init__.py +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git.py +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git_branch.py +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git_log.py +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git_pretty_log.py +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git_show.py +0 -0
- {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git_status.py +0 -0
|
@@ -37,7 +37,7 @@ class ShellConsoleLexer(Lexer):
|
|
|
37
37
|
r'(?P<venv>\([^\)]*\))?', # Virtualenv
|
|
38
38
|
r'(\s*)?', # Whitespace
|
|
39
39
|
r'\[?', # Start bracketed prompt
|
|
40
|
-
r'(?P<user_host>[
|
|
40
|
+
r'(?P<user_host>[\S @]+@[^\s]+?)', # user@host
|
|
41
41
|
r'(\s*)', # Whitespace
|
|
42
42
|
r'(?:(\:)|(\s+))', # Separator: colon or space
|
|
43
43
|
r'(\s*)', # Whitespace
|
|
@@ -212,3 +212,17 @@ def test_bash_prompt_with_virtualenv_and_git_branch_and_command_output():
|
|
|
212
212
|
(Token.Text.Whitespace, "\n"),
|
|
213
213
|
(Token.Generic.Output, "Hello world!\n"),
|
|
214
214
|
]
|
|
215
|
+
|
|
216
|
+
def test_bash_prompt_with_spaces():
|
|
217
|
+
lexer = ShellConsoleLexer()
|
|
218
|
+
prompt = "Fri Sep 13 09:30:00 user@host:~/project $"
|
|
219
|
+
|
|
220
|
+
tokens = list(lexer.get_tokens(prompt))
|
|
221
|
+
|
|
222
|
+
assert tokens == [
|
|
223
|
+
(Token.Generic.Prompt.UserHost, "Fri Sep 13 09:30:00 user@host"),
|
|
224
|
+
(Token.Generic.Prompt, ":"),
|
|
225
|
+
(Token.Generic.Prompt.Directory, "~/project"),
|
|
226
|
+
(Token.Text.Whitespace, " "),
|
|
227
|
+
(Token.Generic.Prompt, "$\n"),
|
|
228
|
+
]
|
{pygments_shell_console-0.3 → pygments_shell_console-0.4}/.github/workflows/publish-to-pypi.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|