Description
Summary
I'm definitely seeing some weird behavior here. At first I thought it was something with uv
generally, but that does not appear to be the case. I could be doing something wrong, but...
pipx install shibboleth==25.3.0b1
shibboleth
Welcome to Shibboleth 25.3.0b1, the tool designed to be *your*
secret weapon.
Your editor is currently vim. If you don't like that, you
should change or set your EDITOR environment variable.
⇀shibboleth:/home/wayne
This is the expected output. If I run
uv tool install shibboleth==25.3.0b1
shibboleth
On my Linux 6.13.8-arch1-1 x86_64 GNU/Linux
machine, this works the same. However, after a pipx uninstall shibboleth
uvx --from=shibboleth==25.3.0b1 shibboleth
Welcome to Shibboleth 25.3.0b1, the tool designed to be *your*
secret weapon.
Your editor is currently vim. If you don't like that, you
should change or set your EDITOR environment variable.
⇀[34mshibboleth[0m:/home/wayne>
It appears to be escaping the ansi escape sequences. uv tool install shibboleth==25.3.0b1
has the same effect shibboleth
ansi colors get borked.
But when I use my system Python:
✦ ❯ PYTHONPATH=/home/wayne/.local/share/uv/tools/shibboleth/lib64/python3.13/site-packages/ python $(which shibboleth)
Welcome to Shibboleth 25.3.0b1, the tool designed to be *your*
secret weapon.
Your editor is currently vim. If you don't like that, you
should change or set your EDITOR environment variable.
⇀shibboleth:/home/wayne
>
Everything is great!
So it appears to have something to do with uv
s python. Indeed:
/home/wayne/.local/share/uv/tools/shibboleth/bin/python ~/.local/share/uv/tools/shibboleth/lib/python3.13/site-packages/shibboleth.py
is borked, but system python works.
Knowing that I went ahead and pulled some of the colorizing code from shibboleth and adapted it a bit:
print(f'\x1b[32mThis is sad\x1b[0m' )
But... that worked. Putting it in a script worked. What other difference was there? OOooo. cmd.Cmd
import cmd
bad = f'\x1b[32mThis is sad\x1b[0m'
class Ok(cmd.Cmd):
prompt = bad
def do_quit(self, line):
return True
print(bad)
Ok().cmdloop()
print(bad)
There it is. Something within uv doesn't play well with cmd.Cmd.
But then things get very interesting! With a lil' tweak to the script to make this clear:
Interactively, the colors are correctly displayed with the uv tool python. Non-interactively? Something goes haywire, at least under WSL 🤷
If there's a command or env var, or flag I can add to the shibboleth entrypoint to try and make the colors work... let me know!
Platform
Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 GNU/Linux
Version
0.5.7
Python version
Python 3.13.1