deshaw / pyflyby

A set of productivity tools for Python
https://deshaw.github.io/pyflyby/
Other
353 stars 52 forks source link

'N' is used for string completion while debugging using pyflyby debugger (PyInf#8704) #213

Closed dshivashankar1994 closed 1 year ago

dshivashankar1994 commented 2 years ago

"N" is not getting treated as character and instead of 'tab', 'N' is used for code completion

This is because of a bug with the pyflyby code (here)

color_scheme = _get_ipython_color_scheme(app)
pdb_instance = pdb_class(color_scheme)

The pdb class constructor's first argument is completekey (defaults to 'tab')

The optional argument 'completekey' is the readline name of a completion key; it defaults to the Tab key. If completekey is not None and the readline module is available, command completion is done automatically.

Now, the color_scheme evaluates to "Neutral" which is passed as completekey because of which "N" is treated as code completion key and not considered as character.

FWIW, old PDB constructor was taking the 'color_scheme' as the first parameter and while upgrading with new versions, this was missed.

Task here is to find a way to propagate the color schemes while launching the debugger.

dshivashankar1994 commented 1 year ago

Internal ticket PyInf#8704

asmeurer commented 1 year ago

If I'm reading the IPython code correctly, the color scheme is already set in the Pdb class automatically, so there's no need to do anything there.

Fix at https://github.com/deshaw/pyflyby/pull/229. For whatever reason tab was not being set as the complete key unless I passed it manually, even though it ought to be the default.