Specifically, self.prompt, and self.intro. That definitely didn't work for me and so I wound up setting sys.ps1 for the prompt and passing the "banner" parameter to bpython.embed(). And even if self.intro works, (does it?) passing it as a parameter to embed() seems a lot more straightforward and less magical.
So that's the stuff I could figure out. Now onto the I can't.
The first problem I have is getting out of bpython. It seems to close sys.stdout. It does this even if inside bpython if I run "raise SystemExit", "raise SystemError", quit() or enter Ctrl-D (EOF). So how can I get out of bpython without it closing stdout?
The second problem I encounter is in running callbacks into the debugger such as for listing files, changing frames for evaluation and so on. I get no output, unless I add a gratuitous print('') statement. And even then I am getting line feeds (\n) without a carriage return. What's going on there?
The last problem is a more minor. embed() has a parameter to set locals, but none to set globals. I suppose I could fold or put all globals variables into the local scope. But aside from being ugly and potentially time consuming, it's semantically wrong.
$ trepan2 myscript.py
(trepan2) bpython
trepan2 python shell with locals
Use dbgr(*string*) to issue debugger command: *string*
trepan2 >>>
As you say, since you are familiar with bpython hopefully this will be a breeze for you.
Cheers,
Rocky