Giter Site home page Giter Site logo

Comments (7)

cabello avatar cabello commented on August 18, 2024 2

I just confirmed this works as expected. Thanks for the quick fix.

from highline.

abinoam avatar abinoam commented on August 18, 2024

Great catch. Confirmed in my machine. I can't promise taking a look at it really quickly. But I'll try it at least next week. (If you see a patch before this, please open a PR). This may have a huge impact in running scripts in pipes.

Thank you.

from highline.

abinoam avatar abinoam commented on August 18, 2024

Perhaps related to piotrmurach/tty-prompt#49

from highline.

abinoam avatar abinoam commented on August 18, 2024

Checking here that input.tty? and input.isatty is false when pipeing and true calling the script directly.
But perhaps this check is not reliable between platforms.
No methods from HighLine::Terminal::IOConsole works correctly (when pipeing. eg: terminal_size)
This points to us that we should identify early and use another terminal class to handle it (to be created).

Ruby stdlib io/console has advanced a little from my last touch at this code. Now we have things like getpass (http://ruby-doc.org/stdlib-2.6/libdoc/io/console/rdoc/IO/generic_readable.html#method-i-getpass). Some things in HighLine should be directly relying on it.

from highline.

abinoam avatar abinoam commented on August 18, 2024

Well, currently we treat input, output as being from the same "type". But when pipeing input can be a file and output a terminal.

from highline.

abinoam avatar abinoam commented on August 18, 2024

I've just assembled a quick and dirt fix.
Released https://rubygems.org/gems/highline/versions/2.0.1
@cabello could you please give me any feedback if this fix is enough for your software.
I'll probably look at this later for a better solution.

from highline.

abinoam avatar abinoam commented on August 18, 2024

The HighLine's assumption that input and output is the same type is broken.

from highline.

Related Issues (20)

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.