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

Issues with custom colors, zsh + keyboard shortcuts #478

Open
maurcz opened this issue Dec 8, 2021 · 2 comments
Open

Issues with custom colors, zsh + keyboard shortcuts #478

maurcz opened this issue Dec 8, 2021 · 2 comments

Comments

@maurcz
Copy link

maurcz commented Dec 8, 2021

Hello! First of all I just want to thank you for all the hard work put into this package - huge fan of custom colors and I can't live without sticky mode anymore :)

Here's my custom .pdbrc.py configuration file:

import pdb

class Config(pdb.DefaultConfig):
    highlight = False
    sticky_by_default = True
    prompt = '[pdb++] '
    use_pygments = True
    pygments_formatter_class = "pygments.formatters.TerminalTrueColorFormatter"
    pygments_formatter_kwargs = {"style": "monokai"}

I'm used to install pdbpp from source (following directions I got from some comments in this repo) with pip install git+git://github.com/pdbpp/pdbpp@master. Here's my pip freeze:

fancycompleter @ git+https://github.com/pdbpp/fancycompleter@8ae963eff76b327b7533f39f40d04eb2b99fa3fd
pdbpp @ git+git://github.com/pdbpp/pdbpp@b757794857f98d53e3ebbe70879663d7d843a6c2
Pygments==2.10.0
pyrepl @ git+https://github.com/pdbpp/pyrepl@f1e5513e069c8b2fac5380fa7869277a6360b65a
six==1.16.0
wmctrl==0.4

And as you can see I get colors normally:

image

However, recently I've started to get issues with certain keyboard shortcuts (I use zsh+powerlevel10k). i.e. Home or End won't work, as well as holding Option / Control and key arrows to navigate between words. Using tab completions within pdbpp will also yield weird results:

image

I've narrowed this issue down to pyrepl and uninstalling the package fixes the issues with the keyboard shortcuts. I'm also aware that I might stumble across issues like this by installing packages from source, so I'm ok with this solution.

But if the issue is "fixed", then why am I here? Well, while doing some investigation I decided to give the version of pdbpp published to PyPi a try. Turns out that colors suddenly won't work anymore with the package published to PyPi, event though I haven't touched my .pdbrc file. New pip freeze:

fancycompleter==0.9.1
pdbpp==0.10.3
Pygments==2.10.0
pyrepl==0.9.0
wmctrl==0.4

Colors are gone (but no keyboard shortcuts issues!):
image

That's super weird, but digging into the problem I've noticed that a file called pdb.py was installed to my environment, and that has no code whatsoever related to Pygments:

image

In contrast, this is the tree I get if I install pdbpp from source:
image

That file has the section that understand Pygments ( which I believe is essentially this code).

Bottom line:

  • pdbpp from source has issues with keyboard shortcuts on zsh due to pyrepl. Uninstalling pyrepl fixes the issue.
  • pdbpp from PyPi won't work with my previous .pdbrc.py configs. I suspect it has to deal with the code being packaged in the whl.

Anyway, some weird stuff going on, sorry for the long post but just wanted to provide as much information as possible. I've debated over separating these into two issues, but ultimately settled for a single issue that explains the whole story of how I found the problems.

Let me know if you need any further info. Thanks again for the awesome work here!

@giladbarnea
Copy link

I had the problem with pyrepl ==0.8.5, then after pip install -U pyrepl to 0.9.0, the problem was gone. Maybe it's not removing pyrepl but something more nuanced

@jamilraichouni
Copy link

I had the problem with pyrepl ==0.8.5, then after pip install -U pyrepl to 0.9.0, the problem was gone. Maybe it's not removing pyrepl but something more nuanced

Wow cool! Thank you. That solved this issue here for me: #52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants