Skip to content

GNU Readline goes haywire if prompt contains ANSI color codes #92

@tleonhardt

Description

@tleonhardt

If at any point the cmd2 prompt gets changed to involve anything involving color via ANSI color escape codes, then the behavior of readline when the up and down arrows are pressed gets really messed up.

This is due to a bug in how GNU Readline calculates the prompt length when the Python3 input() or Python2 raw_input() methods are called. This article has more info:
https://bugs.python.org/issue17337

Ideally, we can make cmd2 protect against this case, even though it is fundamentally a bug in GNU Readline.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions