Git Product home page Git Product logo

Comments (6)

mptre avatar mptre commented on September 6, 2024

On Wed, May 04, 2016 at 02:50:51PM -0700, Aurélien Ooms wrote:

Yank does not exit directly when there's nothing in stdin. For example echo | yank waits for user input.

No news is good news, meaning if the input is empty or does not contain
any fields there will be no feedback. This is a common idiom among Unix
commands.

Moreover, in this example, if I press Enter I get

yank: write: Bad address

Which version are you using? Should be fixed in v0.6.3.

from yank.

make-github-pseudonymous-again avatar make-github-pseudonymous-again commented on September 6, 2024

v0.6.2

from yank.

mptre avatar mptre commented on September 6, 2024

On Thu, May 05, 2016 at 02:37:36AM -0700, Aurélien Ooms wrote:

v0.6.2

Could you try v0.6.3 or greater and see if it resolves the error?

from yank.

make-github-pseudonymous-again avatar make-github-pseudonymous-again commented on September 6, 2024

It doesn't crash in v0.6.4. However, I see the lack of (strong) distinction between echo | yank and { sleep 839283; echo 'bla'; } | yank as misleading for the user. The only difference I see in terminator is the blinking cursor.

from yank.

mptre avatar mptre commented on September 6, 2024

On Mon, May 09, 2016 at 06:32:23AM -0700, Aurélien Ooms wrote:

It doesn't crash in v0.6.4.

Glad to hear.

However, I see the lack of (strong) distinction between echo | yank and { sleep 839283; echo 'bla'; } | yank as misleading for the user. The only difference I see in terminator is the blinking cursor.

Your sleep example is tricky to detect since stdin remains open and will
until the echo command has finished. This would require one to use
poll/select with a timeout in order to detect "slow" input. If you want
to bypass yank when stdin is empty you could use wrapper command:

#/bin/sh

tmpfile=$(mktemp -t yank.XXXXXX)
trap "rm "$tmpfile"" EXIT

cat >"$tmpfile" # consume stdin

if [ -s "$tmpfile" ]
then
yank <"$tmpfile"
else
echo "stdin is empty, skipping yank..." 1>&2
exit 1
fi

from yank.

make-github-pseudonymous-again avatar make-github-pseudonymous-again commented on September 6, 2024

Ok

from yank.

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.