Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xonsh throws exceptions on initialization only when carapace is added to the run control #1068

Open
2 of 13 tasks
JeffMelton opened this issue Dec 29, 2024 · 2 comments
Open
2 of 13 tasks
Labels
bug Something isn't working darwin fund Fundable with polar.sh xonsh

Comments

@JeffMelton
Copy link

JeffMelton commented Dec 29, 2024

Current Behavior

After adding exec($(carapace _carapace)) to ~/.config/xonsh/rc.xsh, Xonsh throws exceptions on initialization (examples with minimal traceback below). Happy to bring more detail if needed.

Expected Behavior

Xonsh should initialize without exceptions when carapace is added to the run control.

Steps To Reproduce

To try and track down what was happening, I added echo statements — this is <whatever the file is> — to the top of my Bash and Zsh run control files. My login shell is Zsh, but I do not use it — there's nothing in the run control file except the echo. All the examples below are run from iTerm2 profiles dedicated to the shell indicated.

Examples with Bash, Zsh, and Elvish run control files available:

From Xonsh:

this is bashrc
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
  File "<string>", line 3
    get-env () { echo "${!1}"; } # this looks like Elvish, but I'm not getting a debug print statement from my `rc.elv`
               ^
SyntaxError: invalid syntax
syntax error in xonsh run control file '/Users/j0m0aam/.config/xonsh/rc.xsh': invalid syntax (<string>, line 3)

~

From Zsh:

~ % xonsh
zsh: command not found: xonsh 
~ % ~/.local/xonsh-env/bin/xonsh
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
  File "<string>", line 3
    get-env () { echo "${(P)1}"; }
               ^
SyntaxError: invalid syntax
syntax error in xonsh run control file '<my home dir>/.config/xonsh/rc.xsh': invalid syntax (<string>, line 3)


~~ % ~/.local/xonsh-env/bin/xonsh --no-rc
~ @

Examples without Bash, Zsh, and Elvish run control files available:

From Xonsh:

xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
  File "<string>", line 3
    get-env () { echo "${!1}"; }
               ^
SyntaxError: invalid syntax
syntax error in xonsh run control file '<my home dir>/.config/xonsh/rc.xsh': invalid syntax (<string>, line 3)

From Zsh:*

 ~ % ~/.local/xonsh-env/bin/xonsh
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
  File "<string>", line 3
    get-env () { echo "${(P)1}"; }
               ^
SyntaxError: invalid syntax
syntax error in xonsh run control file '<my home dir>/.config/xonsh/rc.xsh': invalid syntax (<string>, line 3)


~
❯
 ~ % ~/.local/xonsh-env/bin/xonsh --no-rc
 ~ @

Version

No response

OS

  • Darwin
  • Linux
  • Termux
  • Windows

Shell

  • Bash
  • Cmd
  • Elvish
  • Fish
  • Nushell
  • Oil
  • Powershell
  • Xonsh
  • Zsh

Anything else?

No response

Polar

Fund with Polar
@JeffMelton JeffMelton added bug Something isn't working fund Fundable with polar.sh labels Dec 29, 2024
@JeffMelton JeffMelton changed the title <title>Xonsh throws exceptions on initialization only when carapace is added to the run control Xonsh throws exceptions on initialization only when carapace is added to the run control Dec 29, 2024
@rsteube
Copy link
Member

rsteube commented Dec 29, 2024

Looks like the detection isn't working. It's a simple check using the parent process names.

Do you still get the exceptions with:

# ~/.config/xonsh/rc.xsh
exec($(carapace _carapace xonsh))

@JeffMelton
Copy link
Author

Looks like the detection isn't working. It's a simple check using the parent process names.

Do you still get the exceptions with:

# ~/.config/xonsh/rc.xsh

exec($(carapace _carapace xonsh))

Nope, that works as expected. 👍 That's good enough for me. Thank you (and thanks for making carapace, et al.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working darwin fund Fundable with polar.sh xonsh
Projects
None yet
Development

No branches or pull requests

2 participants