reedline icon indicating copy to clipboard operation
reedline copied to clipboard

Impossible testing with pexpect

Open godzie44 opened this issue 2 years ago • 2 comments

Platform linux Terminal software pseudo terminal - python pty

I'm trying to write integration tests of reedline app with python pexpect lib, and, unfortunately, it's fail. Looks like problem in crossterm, but I'm not sure.

Steps to reproduce

This can be reproduced on basic example:

>>> import pexpect
>>> proc = pexpect.spawn("./target/debug/examples/basic")
>>> print(proc.readline())
b'\x1b[6nError: Custom { kind: Other, error: "The cursor position could not be read within a normal duration" }\r\n'

godzie44 avatar Jun 12 '23 10:06 godzie44

Would love to see if we can handle the absence of certain behaviors of a proper terminal more gracefully. Being able to test reedline end-to-end would be very welcome.

There seems to be a related limitation if we block as soon as we assume there is no full TTY connected https://github.com/nushell/nushell/issues/9497

sholderbach avatar Jun 26 '23 09:06 sholderbach