Skip to content

Piping Buffer #1302

Closed
Closed

Description

@olegbl

It seems like live buffers are not piped appropriately.

For instance:

adb logcat | grep "tag"

only spits out the log once I ctrl-c the process. Regular logcat spits out logs as they are made. In bash this works without issue.

Activity

  1. ridiculousfish commented on Feb 15, 2014

    @ridiculousfish
    Member

    Does it do what you expect if you run it with command grep instead of grep?

  2. olegbl commented on Feb 18, 2014

    @olegbl
    Author

    Thanks for the quick attention!
    No, it does not. Behavior seems identical with "command grep". I have to kill it to see output.

  3. ridiculousfish commented on Feb 20, 2014

    @ridiculousfish
    Member

    Do you have a grep function defined? I.e. does functions grep produce output?

  4. olegbl commented on Feb 20, 2014

    @olegbl
    Author

    "function grep" leaves me sitting with a blank input - I can type stuff in, but nothing happens. Once I ctrl-c, all I typed in clears.

    "which grep" returns /usr/bin/grep

    "adb logcat | echo" has the same behavior

    Thanks!

  5. ridiculousfish commented on Feb 20, 2014

    @ridiculousfish
    Member

    Ah, note the plural function_s_ :)

    I haven't been able to reproduce this.

  6. olegbl commented on Feb 20, 2014

    @olegbl
    Author

    Thanks! Totally missed that. functions grep returns nothing.

    It's quite strange. Running "grunt watch | grep reload" works just fine - it's just adb logcat that seems to not be working (though both work the same in bash).

    Anyway, thanks for your help! Not a big deal to work around.

  7. jonhoo commented on Dec 6, 2014

    @jonhoo
    Contributor

    Just encountered this bug myself. This reproduces the behaviour every time for me:

    $ cat test.log 
    test
    test
    test
    test
    test
    test
    test
    $ cat test.log | while read r; sleep 1; echo "$r"; end | cat -
    # notice that nothing is printed until ^C or until cat finishes
    ^Ctest
    test
    test
    test
    test
    test
    $ sh -c 'cat test.log | while read -r r; do sleep 1; echo "$r"; done | cat -'
    # notice that a line is printed every second
    test
    test
    test
    ^C
    $ fish --version
    fish, version 2.1.1
    
  8. jonhoo commented on Dec 6, 2014

    @jonhoo
    Contributor

    Ah, just saw this comment over in #1396. I guess it'll be tracked there.

  9. locked as resolved and limited conversation to collaborators on Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions