Skip to content

Different behavior of printing strings with ANSI escape codes #758

Open
@amiramitai

Description

@amiramitai

bpython prints lines differently than python when ANSI escape codes are involved.

I was able to reproduce the bug with the following setups:

  • bpython version 0.17.1 on top of Python 2.7.10, macOS
  • bpython version 0.17.1 on top of Python 3.7.0, macOS
  • bpython version 0.17.1 on top of Python 3.7.1, linux (docker)

Reproduction code:

import os
width = int(os.popen('stty size', 'r').read().split()[1])
print('\33[31m' + ('#' * width) + '\33[0m')

The code suppose to fill up a full width terminal line with red hashes.
In python it works as expected. In bpython the line breaks toward the end and it goes back to the regular color at the second line.
screen shot 2018-12-02 at 13 00 29
screen shot 2018-12-02 at 13 00 56

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions