Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Prompt spacing weird #1104

Closed
rkern opened this Issue · 3 comments

2 participants

Robert Kern Thomas Kluyver
Robert Kern
Collaborator

Running off of master using takluyver's recent modifications to the prompt templating. I have a fairly customized multiline prompt based off of one of the configuration examples from the 0.9(?) era:

[~]
|1> 10
        10

[~]
|2> cd scratch
/Users/rkern/scratch

[~/scratch]
|3> 10
                10

[~/scratch]
|4> cd ..
/Users/rkern

        [~]
|5> 10
                10

In the current scheme, I have these settings:

c.PromptManager.in_template = r'{color.Blue}[{color.Cyan}\Y1{color.Blue}]\n{color.LightGreen}|\#> '
c.PromptManager.in2_template = '.\D> '
c.PromptManager.out_template = ''

All lines should be flush with the left side of the screen.

Thomas Kluyver takluyver was assigned
Thomas Kluyver
Owner

The steadily increasing spacing is a bug, but the default is not to have all lines flush with the left side of the screen. If you do want that behaviour, you need to set c.PromptManager.justify = False. Otherwise, it tries to line the start of each line up with the line before.

I'll look into the increasing spacing.

Robert Kern
Collaborator

It looks like part of the problem is that you are just counting characters, not taking into account newlines and maybe not the color control characters (I haven't looked too closely).

Thomas Kluyver
Owner

Colour control characters are taken into account, but the newlines aren't. Well spotted, it should be an easy fix.

Thomas Kluyver takluyver referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Thomas Kluyver takluyver closed this in 82193fb
Brian E. Granger ellisonbg referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
matthew von rocketstein mattvonrocketstein referenced this issue from a commit in mattvonrocketstein/ipython
Thomas Kluyver takluyver Fix for prompts containing newlines.
Closes gh-1104
5067844
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.