anki-code / xontrib-prompt-starship

Starship cross-shell prompt in xonsh shell.
MIT License
51 stars 8 forks source link

Fails to format prompt when xonsh running from outside shell #1

Closed hemna closed 3 years ago

hemna commented 3 years ago
i530566@C17ZL21PMD6M ~ $ xpip install xontrib-prompt-starship
Collecting xontrib-prompt-starship
  Using cached xontrib_prompt_starship-0.0.2-py3-none-any.whl (2.8 kB)
Requirement already satisfied: xonsh in ./.pyenv/versions/3.8.7/lib/python3.8/site-packages (from xontrib-prompt-starship) (0.9.27)
Installing collected packages: xontrib-prompt-starship
Successfully installed xontrib-prompt-starship-0.0.2
i530566@C17ZL21PMD6M ~ $ xontrib load prompt_starship
Failed to format prompt `<function <lambda> at 0x10469f9d0>`-> <class 'ValueError'>:expected '}' before end of string

%{%}~%{%} via %{%}🐍 %{%}%{%}%{%}%{%}v3.8.7%{%}%{%} %{%}
%{%}❯%{%}
%{%}❯%{%} xonfig
+------------------+----------------------+
| xonsh            | 0.9.27               |
| Git SHA          | 71fe9014             |
| Commit Date      | Jan 29 08:58:58 2021 |
| Python           | 3.8.7                |
| PLY              | 3.11                 |
| have readline    | True                 |
| prompt toolkit   | 3.0.16               |
| shell type       | prompt_toolkit       |
| pygments         | 2.8.0                |
| on posix         | True                 |
| on linux         | False                |
| on darwin        | True                 |
| on windows       | False                |
| on cygwin        | False                |
| on msys2         | False                |
| is superuser     | False                |
| default encoding | utf-8                |
| xonsh encoding   | utf-8                |
| encoding errors  | surrogateescape      |
| on jupyter       | False                |
| jupyter kernel   | None                 |
| xontrib 1        | abbrevs              |
| xontrib 2        | argcomplete          |
| xontrib 3        | autovox              |
| xontrib 4        | autoxsh              |
| xontrib 5        | avox                 |
| xontrib 6        | avox_poetry          |
| xontrib 7        | back2dir             |
| xontrib 8        | cmd_done             |
| xontrib 9        | commands             |
| xontrib 10       | coreutils            |
| xontrib 11       | direnv               |
| xontrib 12       | docker_tabcomplete   |
| xontrib 13       | fzf-widgets          |
| xontrib 14       | gitinfo              |
| xontrib 15       | histcpy              |
| xontrib 16       | prompt_starship      |
| xontrib 17       | sh                   |
| xontrib 18       | vox                  |
| xontrib 19       | voxapi               |
| xontrib 20       | z                    |
+------------------+----------------------+
hemna commented 3 years ago

This happens when I login to my mac, which has zsh as my default shell. The ~/.zshrc has an enabled version of starship prompt

eval "$(starship init zsh)"

then I fire up xonsh that has this xontrib installed and loaded.

anki-code commented 3 years ago

Hi @hemna ! Thank you for reporting! Fixed in 0.0.3 please update:

pip install -U xontrib-prompt-starship

If you like the xontrib click ⭐ on the repo :)

anki-code commented 3 years ago

Hi @hemna! We have massive updates here. If you still using starship please take a look at README for the new RIGHT_PROMPT feature. An example of the configuration file you can find here - https://gist.github.com/eugenesvk/fd185f49017cb64a4cfb076bde8b605d#file-starship_right-toml

If you like the xontrib give the repo a star. Thanks!