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

@rkern

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.

@takluyver takluyver was assigned
@takluyver
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.

@rkern

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).

@takluyver
Owner

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

@takluyver takluyver referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@takluyver takluyver closed this in 82193fb
@ellisonbg ellisonbg referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@mattvonrocketstein mattvonrocketstein referenced this issue from a commit in mattvonrocketstein/ipython
@takluyver 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.