[go: up one dir, main page]

Menu

#9 Optionally remove carriage returns

Unstable (example)
closed
nobody
None
5
2014-06-03
2007-02-26
Scott Lamb
No

The normal tty behavior is to send \r\n instead of \n. This can interact badly with some systems - in particular, if using pexpect from a buildbot with logfile set to stdout, everything is double-spaced in the logs.

It's useful to strip these out. On most systems you could probably do that by masking out termios.ONLCR during tty setup. That's not an option on my system for complicated reasons I won't get into, so this patch instead works by removing all carriage returns by regular expression on input from the tty.

Discussion

  • Scott Lamb

    Scott Lamb - 2007-02-26

    Optionally remove carriage returns

     
  • Scott Lamb

    Scott Lamb - 2007-02-26
    • summary: Optionaly remove carriage returns --> Optionally remove carriage returns
     
  • Thomas Kluyver

    Thomas Kluyver - 2014-06-03
    • status: open --> closed
    • Group: --> Unstable (example)
     
  • Thomas Kluyver

    Thomas Kluyver - 2014-06-03

    I'm inclined to say that this isn't up to pexpect - you can easily strip carriage returns out after getting the data from pexpect if they're causing problems. If you still think it's a problem, please make an issue or PR on Github for it. Thanks.

    https://github.com/pexpect/pexpect

     

Log in to post a comment.