xonsh
Repos
33

:shell: Python-powered, cross-platform, Unix-gazing shell

6333
554

Awesome list of Xonsh contributions/extensions

14
1

A cookiecutter template for xontribs, a.k.a xonsh contributions

12
12

Events

started
Created at 5 hours ago
Created at 6 hours ago
issue comment
Xonsh crashes when Python code contains a typo.

@xlorepdarkhelm try updating the readable-traceback xontrib: https://github.com/vaaaaanquish/xontrib-readable-traceback/issues/7

Created at 17 hours ago
started
Created at 20 hours ago
started
Created at 22 hours ago
started
Created at 1 day ago

deploy: xonsh/xonsh@490f6f26366eb626e2043878f0b72fb126e4a209

Created at 1 day ago
started
Created at 1 day ago
started
Created at 2 days ago
issue comment
#4951 Fix gitstatus prompt when rebasing

Warning! No news item is found for this PR. If this is an user facing change/feature/fix, please add a news item by copying the format from news/TEMPLATE.rst.

Created at 2 days ago
pull request opened
#4951 Fix gitstatus prompt when rebasing

Fix #4951

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

Created at 2 days ago
opened issue
When rebasing gitstatus raises "_GSField.updator() takes 2 positional arguments but 3 were given"

xonfig

+------------------+-----------------+
| xonsh            | 0.13.3          |
| Python           | 3.10.7          |
| PLY              | 3.11            |
| have readline    | True            |
| prompt toolkit   | 3.0.31          |
| shell type       | prompt_toolkit  |
| history backend  | json            |
| pygments         | None            |
| on posix         | True            |
| on linux         | True            |
| distro           | unknown         |
| on wsl           | False           |
| on darwin        | False           |
| on windows       | False           |
| on cygwin        | False           |
| on msys2         | False           |
| is superuser     | True            |
| default encoding | utf-8           |
| xonsh encoding   | utf-8           |
| encoding errors  | surrogateescape |
| xontrib          | []              |
| RC file 1        | /root/.xonshrc  |
+------------------+-----------------+

Expected Behavior

No error

Current Behavior

Xonsh prints the following error when generating the prompt:

prompt: error: on field 'gitstatus'
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
TypeError: _GSField.updator() takes 2 positional arguments but 3 were given

Full traceback below.

Traceback (if applicable)

{ERROR:gitstatus} # 
prompt: error: on field 'gitstatus'
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 133, in _get_field_value
    return self.fields.pick(field)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 381, in pick
    value.update(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 343, in update
    super().update(ctx)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 519, in update
    self.value = self.separator.join(self._collect(ctx))
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 514, in _collect
    yield format(ctx.pick(frag))
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 381, in pick
    value.update(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 126, in update
    self.updator(self, ctx)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 246, in get_gitstatus_info
    info = ctx.pick_val(porcelain)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 391, in pick_val
    val = self.pick(key)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 381, in pick
    value.update(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 126, in update
    self.updator(self, ctx)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 206, in porcelain
    branch = ctx.pick(tag_or_hash) or ""
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 381, in pick
    value.update(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 126, in update
    self.updator(self, ctx)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 146, in tag_or_hash
    fld.value = ctx.pick(tag) or ctx.pick(short_head)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/base.py", line 381, in pick
    value.update(self)
  File "/usr/local/lib/python3.10/site-packages/xonsh/prompt/gitstatus.py", line 126, in update
    self.updator(self, ctx)
TypeError: _GSField.updator() takes 2 positional arguments but 3 were given

Steps to Reproduce

  1. Set .xonshrc to this:
$PROMPT = (
    "{gitstatus} {prompt_end}{RESET} "
)
# you might also want to turn on:
# $XONSH_SHOW_TRACEBACK = True
  1. Create a git repo with a few commits
  2. git rebase --interactive <old-commit>
  3. Set some commits to edit to pause the rebase at that commit
  4. cd a xonsh shell to that git directory

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

Created at 2 days ago
started
Created at 2 days ago
started
Created at 2 days ago
issue comment
Versions >0.11.0 broken on Windows

Hmm, just pip

Created at 2 days ago
started
Created at 2 days ago
issue comment
Versions >0.11.0 broken on Windows

Sorry about the breakage @ofek -- does this affect all completers or is it only the pip completer that is doing this?

Created at 2 days ago
started
Created at 2 days ago
started
Created at 2 days ago
started
Created at 3 days ago

deploy: xonsh/xonsh@f54f6978a52ec22f57414bc65b591f037de088e0

Created at 3 days ago

[pre-commit.ci] pre-commit autoupdate (#4949)

updates:

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

Created at 3 days ago
pull request closed
[pre-commit.ci] pre-commit autoupdate
Created at 3 days ago

[pre-commit.ci] pre-commit autoupdate (#9)

updates:

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

Created at 3 days ago
pull request closed
[pre-commit.ci] pre-commit autoupdate
Created at 3 days ago
opened issue
Versions >0.11.0 broken on Windows

xonfig

$ xonfig
+------------------+-------------------------+
| xonsh            | 0.13.3                  |
| Python           | 3.10.7                  |
| PLY              | 3.11                    |
| have readline    | False                   |
| prompt toolkit   | 3.0.31                  |
| shell type       | prompt_toolkit          |
| history backend  | sqlite                  |
| pygments         | 2.13.0                  |
| on posix         | False                   |
| on linux         | False                   |
| on darwin        | False                   |
| on windows       | True                    |
| on cygwin        | False                   |
| on msys2         | False                   |
| is superuser     | False                   |
| default encoding | utf-8                   |
| xonsh encoding   | utf-8                   |
| encoding errors  | surrogateescape         |
| xontrib 1        | prompt_starship         |
| RC file 1        | C:\Users\ofekm/.xonshrc |
+------------------+-------------------------+

Expected Behavior

Tab completion of files/directories works and no crashes occur

Current Behavior

pip install -e .\d has no completion & pip install -e .\datadog_checks_dev:

Traceback (if applicable)

❯ pip install -e .\datadog_checks_dev
Traceback (most recent call last):
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\__main__.py", line 3, in <module>
    main()
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\main.py", line 470, in main
    _failback_to_other_shells(args, err)
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\main.py", line 439, in _failback_to_other_shells
    raise err
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\main.py", line 468, in main
    sys.exit(main_xonsh(args))
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\main.py", line 512, in main_xonsh
    shell.shell.cmdloop()
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\ptk_shell\shell.py", line 401, in cmdloop
    line = self.singleline(auto_suggest=auto_suggest)
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\ptk_shell\shell.py", line 369, in singleline
    line = self.prompter.prompt(**prompt_args)
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\prompt_toolkit\shortcuts\prompt.py", line 1034, in prompt
    return self.app.run(
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\prompt_toolkit\application\application.py", line 978, in run
    return loop.run_until_complete(
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
    return future.result()
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\prompt_toolkit\application\application.py", line 891, in run_async
    await self.cancel_and_wait_for_background_tasks()
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\prompt_toolkit\application\application.py", line 1092, in cancel_and_wait_for_background_tasks
    await task
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\prompt_toolkit\buffer.py", line 1912, in new_coroutine
    await coroutine(*a, **kw)
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\prompt_toolkit\buffer.py", line 1739, in async_completer
    async for completion in self.completer.get_completions_async(
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\prompt_toolkit\completion\base.py", line 271, in get_completions_async
    async for completion in completer.get_completions_async(
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\prompt_toolkit\completion\base.py", line 198, in get_completions_async
    for item in self.get_completions(document, complete_event):
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\ptk_shell\completer.py", line 58, in get_completions
    completions, plen = self.completer.complete(
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\completer.py", line 121, in complete
    return self.complete_from_context(
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\completer.py", line 272, in complete_from_context
    for comp in self.generate_completions(
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\completer.py", line 233, in generate_completions
    for comp in res:
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\completers\tools.py", line 292, in comp_based_completer
    yield from complete_from_sub_proc(
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\site-packages\xonsh\completers\tools.py", line 271, in complete_from_sub_proc
    lines = sep(output)
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\shlex.py", line 315, in split
    return list(lex)
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\shlex.py", line 300, in __next__
    token = self.get_token()
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\shlex.py", line 109, in get_token
    raw = self.read_token()
  File "C:\Users\ofekm\AppData\Local\Programs\Python\Python310\lib\shlex.py", line 210, in read_token
    raise ValueError("No escaped character")
ValueError: No escaped character

[process exited with code 1 (0x00000001)]

Steps to Reproduce

pip install -U xonsh[full]

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

Created at 3 days ago

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Created at 3 days ago

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Created at 3 days ago