prompt-toolkit / ptpython

A better Python REPL
BSD 3-Clause "New" or "Revised" License
5.23k stars 281 forks source link

Setting _extra_toolbars #594

Open bwildenborg opened 1 month ago

bwildenborg commented 1 month ago

I'm interested in setting the _extra_toolbars of the underlying REPL when using embed which does not seem to provide any means of setting this. I also tried setting _extra_toolbars of the REPL through a configure function, but that had no effect. Sifting through the source code it looks like I would have to redo a ton of setup logic to get that to happen. Am I missing something, or do I just need to make a feature request for this? FWIW, it was as simple as adding an arg to embed, then passing it through the to the constructor of ptpython.repl.PythonRepl.

jonathanslenders commented 1 month ago

IIRC, I added this at some point for ptpdb (a ptpython based pdb repl), along with a few other things. It was never really meant as a feature for end users to build upon, and ptpdb was not further developed. To be honest, at this point I don't have the bandwidth to work on this kind of specialized extensibility. Can I ask what would be the reason for this feature?

bwildenborg commented 1 month ago

We've got Python embedded into a custom environment and I am displaying some details on our internal systems. It all seems to work well, all I did was modify the embed function to pass through a toolbar arg to the REPL instantiation.