microsoft / inshellisense

IDE style command line auto complete
MIT License
8.21k stars 179 forks source link

Inshellisense error in Xonsh (0.16) #263

Open dedguy21 opened 1 week ago

dedguy21 commented 1 week ago

Describe the bug

Getting the following error when running "is" in xonsh:

xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
  File "/usr/lib/node_modules/@microsoft/inshellisense/shell/shellIntegration.xsh", line 37, in <module>
    $PROMPT = "{__is_prompt_start}{__is_update_cwd}{__is_report_prompt}" + $PROMPT + "{__is_prompt_end}"

TypeError: can only concatenate str (not "ShellIntegrationPrompt") to str
error running xonsh run control file '/usr/lib/node_modules/@microsoft/inshellisense/shell/shellIntegration.xsh': can only concatenate str (not "ShellIntegrationPrompt") to str

To Reproduce after adding the following to my .xonshrc and restarting xonsh:

# ---------------- inshellisense shell plugin ----------------
if 'ISTERM' not in ${...} and $XONSH_INTERACTIVE:
    if $XONSH_LOGIN:
        is -s xonsh --login ; exit
    else:
        is -s xonsh ; exit

Any time I spawn the xonsh shell I get that error

Steps to reproduce the behavior: Spawn the xonsh shell

Expected behavior I expect inshellisese to be live with no errors

Environment

Additional context Not using a third party prompt engine like "starship", just using the default xonsh prompt_tookit. Xonsh was installed using "pipx". But it is on my path : /home/user/.local/share/pipx/venvs/xonsh/bin /usr/lib/python312.zip /usr/lib/python3.12 /usr/lib/python3.12/lib-dynload /home/air/.local/share/pipx/venvs/xonsh/lib/python3.12/site-packages /home/user/.local/share/pipx/shared/lib/python3.12/site-packages

drdkcisc commented 3 days ago

I'm experiencing somthing similar in Bash through Windows Terminal where Inshellisense seems to be running (through is -c) but it's not showing up. Using oh-my-posh and lsd too.


if [[ -z "${ISTERM}" && $- = *i* && $- != *c* ]]; then
  shopt -q login_shell
  login_shell=$?
  if [ $login_shell -eq 0 ]; then
    is -s bash --login ; exit
  else
    is -s bash ; exit
  fi
fi```