Coder Social home page Coder Social logo

ansiterm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ansiterm's Issues

Cannot be fed from a stream as partial sequences not handled

I tried to use this package to parse data my script was receiving from a stream, but found that it could not handle partial escape sequences - once it sees that the input starts with an escape character, it expects the input to contain a complete escape sequence.

When I added buffering in the package to try to work around this, I found that the regular expression was treating partial sequences as complete sequences.

I suspect that using a regular expression means you cannot handle partial sequences, because a regular expression won't tell you if you have a partial match or not, and you need to know that to determine whether you're ever going to get a match given the current buffered input.

I eventually found that https://github.com/pexpect/pexpect provides an ANSI package which is similar to ansiterm but is able to handle being fed from a stream. I just wanted to mention this as it might be useful information for others. I haven't really done an in-depth comparison of the two packages [edit: but one limitation I've noticed is that pexpect's package doesn't properly parse, and doesn't store, attributes].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.