1

Windows 10 (64 bit), Emacs 25.1.

I has Android application. And in console I start Android command "adb logcat" to show logs from Android device. But it's show many text. And I want to filter to show only lines that I need.

So. I want in console to show only lines that content text "com.android.testproject".

First I show text without filter:

  1. Emacs: run shell (M-x shell)
  2. Run android command : adb logcat

Here result. Show all text (no filter)

enter image description here

OK! Now I want to filter.

My steps on Windows console:

  1. Open windows console: "cmd.exe"
  2. Enter command: adb logcat|grep com.android.testproject
  3. Result is show only lines that content text "com.android.testproject".

It's work. OK.

Here screenshot. enter image description here

Now I want to do same (filter) on Emacs. My steps:

  1. Open shell: "M-x shell"
  2. Enter command: adb logcat|grep com.android.testproject
  3. But nothing happend. Why?

But if I press "C-c C-c" (Break) then in shell success show filtered text.

Question: Why Emacs not immediately filter text?

1
  • It's probably something todo with Windows not implementing PTYs
    – npostavs
    Aug 24, 2017 at 13:56

1 Answer 1

1

Can't answer you directly, however for me, using

GNU Emacs 25.1.1 (x86_64-w64-mingw32) of 2016-09-17

and grep

c:\>grep --version
grep --version
GNU grep 2.5.4

c:\>dir | grep -i pro
dir | grep -i pro
06/08/2017  16:08    <DIR>          Program Files
24/08/2017  19:02    <DIR>          Program Files (x86)

Seem to work okay.

Perhaps if you try with -Q flag to suppress your config and try again?

3
  • Instead of dir, try with a command that doesn't terminate immediately. ping perhaps.
    – npostavs
    Aug 24, 2017 at 21:27
  • I try with -Q flag, but result is the same. Not work correct. My grep version = 3.0.
    – lmdic
    Aug 25, 2017 at 7:09
  • 1
    Okay - I wonder then if this is your problem, see (efaq-w32) Subprocess buffering Aug 25, 2017 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.