Skip to content
This repository

Prompt spacing weird #1104

Closed
rkern opened this Issue December 05, 2011 · 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
Collaborator

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
Collaborator

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 December 05, 2011
Commit has since been removed from the repository and is no longer available.
Thomas Kluyver takluyver closed this in 82193fb December 08, 2011
Brian E. Granger ellisonbg referenced this issue from a commit January 10, 2012
Commit has since been removed from the repository and is no longer available.
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.