Prompt spacing weird #1104

Closed
rkern opened this Issue Dec 5, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@rkern
Contributor

rkern commented Dec 5, 2011

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.

@ghost ghost assigned takluyver Dec 5, 2011

@takluyver

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Dec 5, 2011

Member

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.

Member

takluyver commented Dec 5, 2011

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

This comment has been minimized.

Show comment
Hide comment
@rkern

rkern Dec 5, 2011

Contributor

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

Contributor

rkern commented Dec 5, 2011

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

This comment has been minimized.

Show comment
Hide comment
@takluyver

takluyver Dec 5, 2011

Member

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

Member

takluyver commented Dec 5, 2011

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

@takluyver takluyver closed this in 82193fb Dec 8, 2011

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment