Granular configuration of PyREPL

PyREPL does not appear to read preferences from a configuration file. Here are some pages I found upon searching online:

none of which specify how to configure the behaviour of PyREPL. The basic REPL, on the other hand, could be configured using .inputrc. Following a period of hacking around with Readline, I settled on (among other things):

set colored-completion-prefix on

which, along with the following environment variable:

LS_COLORS='some_colour_settings:so=01;90:more_colour_settings'

resulted in the matched part of programmable completion words being coloured grey in Bash as well as the basic REPL.

Having become used to this visual hint, and the display of completion words on a single press of Tab, PyREPL is marginally difficult for me to use. Not to mention that its behaviour now differs from that of the shell I use it in. I’m sure there must be some power users who have configured Bash to its limits and are now stuck with a similar problem. Is there an easy way I have missed to control the behaviour of PyREPL the way one could control the basic REPL? Failing that, are there any plans to add configurability to PyREPL?

1 Like

My understanding is that the idea of directly supporting .inputrc in the new REPL has been rejected. This stack overflow post has some useful links on the topic.

I don’t know whether or not there are plans to support some sort of custom configuration format.

That’s true; I read in the documentation that there are no plans to support .inputrc because it makes Python dependent on an external program, while the PyREPL is entirely a part of the Python distribution. Nonetheless, I wish there were a way to configure PyREPL, because it feels like a step backwards for someone who had carefully configured the basic REPL. A new thing designed to supersede an older thing should not throw out the features of the latter!

1 Like