Prompts #1083

Merged
merged 4 commits into from Dec 1, 2011

3 participants

@takluyver
IPython member

Building on @minrk's PR #1078.

This makes the rewrite prompt adapt to the size of the previous prompt. The minimum length (by default) is 3 characters: ->. It remains configurable, so if the user wants really short prompts, it can be replaced.

minrk and others added some commits Dec 1, 2011
@minrk minrk PromptManager fixes
* InteractiveShell.prompt_foo traits show deprecation warning, and map to new PromptManager traits
* PromptManager properly added to IPython App, so it will show up in config
* add helpstrings to PromptManager traits.
* Docs / embed references to Shell.prompt_foo also updated
38572c2
@takluyver takluyver Update pysh profile 77a068c
@takluyver takluyver Make size of rewrite prompt flexible. 7a27b8c
@takluyver takluyver referenced this pull request Dec 1, 2011
Closed

PromptManager fixes #1078

@minrk
IPython member

@fperez said in #1078 that rewrite need not be a template at all, and can just be a bool always matching the length of the input prompt.

@fperez
IPython member

Yes: because this is a prompt meant to expand/contract dynamically to the length of the input prompt above it, I'm not really sure that template semantics make any sense here. If users give some other string, what are we supposed to grow and what to keep static? I think it's needless flexibility that adds complexity for no real payoff, so the only option we should give here is, "do you want a rewrite prompt at all or not?".

@fperez
IPython member

This looks good, I tested the functionality and it works just like 0.10x did, so I think we're ok on that front. Once the changes mentioned above are made, to remove the template for the rewrite prompt and make it a simple boolean, we can test again and should be good to merge.

@takluyver
IPython member

By "do you want to see a rewrite prompt", I assume you mean an option to turn off showing rewritten input altogether?

@fperez
IPython member

Yes, sorry if it wasn't clear. I probably said it better in #1078:

I'm actually OK with the rewrite prompt not being a template at all, we're simply saying 'the line above got rewritten'. The rewrite prompt instead could be a simple boolean: if True, we rewrite with '---->' as long as it needs to be, if False we don't show any rewrite. There's no need for having a template there.

Does that make sense?

@takluyver
IPython member

Done.

Added a show_rewritten_input config to InteractiveShell to turn it off.

@fperez
IPython member

Great, looks good now, tests pass, rewrite works correctly. Thanks! merging...

@fperez fperez merged commit 4b8920a into ipython:master Dec 1, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment