| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@tacaswell would this flag name suits you ? @takluyver Should we also check for os.environ["TERM"] == "dumb" |
Sorry, something went wrong.
|
I like 'simple-prompt'. |
Sorry, something went wrong.
| from .pt_inputhooks import get_inputhook_func | ||
| from .interactiveshell import get_default_editor, TerminalMagics | ||
|
|
||
| _use_simple_prompt = 'IPY_TEST_SIMPLE_PROMPT' in os.environ or not sys.stdin.isatty() |
There was a problem hiding this comment.
I think these should probably override config, rather than providing the default value.
Sorry, something went wrong.
There was a problem hiding this comment.
I think the command line flag should take precedence of the env variable, especially since it has the --no-simple-prompt alternative. IIRC that's how most of our commands works.
I'm fine changing if you still think it should be.
Sorry, something went wrong.
|
As #9487 was merged, we also need to make this switch affect the debugger. It can probably just change debugger_cls to the parent class from IPython.core.debugger, which is equivalently plain. |
Sorry, something went wrong.
As this mode seem to be useful beyond testing, expose it via a flag and make it official.
Yes.
Unsure what you mean exactly, I'm confused by the english construct, but gave it a try: + @observe('simple_prompt')
+ def _simple_prompt_changed(self, changes):
+ if changes['new'] == True:
+ self.debugger_cls = Pdb
+ else:
+ self.debugger_cls = TerminalPdb |
Sorry, something went wrong.
|
That's basically what I meant, but I'd just change debugger_cls inside the if clause - simple_prompt can only take effect on startup anyway, so there's no need for traitlets' dynamism. |
Sorry, something went wrong.
|
Since you won't be awake for several hours, I'm going to change it locally and merge. |
Sorry, something went wrong.
|
I realised that init_prompt_toolkit_cli would be too late to change debugger_cls effectively, but I found another way to do it that I like more, using a property. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
As this mode seem to be useful beyond testing, expose it via a flag and
make it official.