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.
Files changed (22) hide show
  1. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/PKG-INFO +1 -1
  2. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/pyproject.toml +1 -1
  3. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/shellconsole_lexer.py +1 -1
  4. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_prompts.py +14 -0
  5. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/.github/workflows/publish-to-pypi.yml +0 -0
  6. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/.gitignore +0 -0
  7. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/README.md +0 -0
  8. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/git_lg.example +0 -0
  9. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/git_log.example +0 -0
  10. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/git_show.example +0 -0
  11. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/status.example +0 -0
  12. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/test.exmpl +0 -0
  13. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/examples/test.sh +0 -0
  14. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/git_lexer.py +0 -0
  15. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/shellconsole_style.py +0 -0
  16. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/__init__.py +0 -0
  17. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git.py +0 -0
  18. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git_branch.py +0 -0
  19. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git_log.py +0 -0
  20. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git_pretty_log.py +0 -0
  21. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git_show.py +0 -0
  22. {pygments_shell_console-0.3 → pygments_shell_console-0.4}/test/test_git_status.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pygments-shell-console
3
- Version: 0.3
3
+ Version: 0.4
4
4
  Requires-Dist: pygments
5
5
  Description-Content-Type: text/markdown
6
6
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pygments-shell-console" # change this to a package name for your plugin
7
- version = "0.3"
7
+ version = "0.4"
8
8
  dependencies = ["pygments"]
9
9
  readme = "README.md"
10
10
 
@@ -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>[^\s@]+@[^\s]+?)', # 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
+ ]