maxming2333 / puttycyg

Automatically exported from code.google.com/p/puttycyg
0 stars 0 forks source link

Flow control #60

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Neat work: it actually makes terminal apps in Windows not, uh, suck.

In a real terminal I often ^S to pause.  Any way to get that or something 
equivalent to work?  I'm using this to view Android device logs, and I can't 
pause the output to examine it without it scrolling away from me.  I keep 
having to copy text into an editor to look at it.

Original issue reported on code.google.com by oldglenn...@gmail.com on 4 Jun 2011 at 8:44

GoogleCodeExporter commented 8 years ago
> Any way to get that or something equivalent to work

What about
$ less yourlogfile

That said, I tried Ctrl-S here, and it paused the listing for me (Ctrl-Q 
resumes).

Please check that your CYGWIN environment variable has "tty" (note that this 
has to be set before Cygwin DLL is loaded, so you should probably initialize it 
in your user or system environment variables)

$ echo $CYGWIN
nodosfilewarning tty

Now the bad news: unfortunately, this does not seem to work in all cases, and I 
don't know why:

Example 1 - OK:
$ for ((x=0;x<100000;x=x+1)); do echo $x; done
==> Ctrl-S / Ctrl-Q work as expected

Example 2 - BAD:
$ wc -l verylonglogfile
310030 verylonglogfile
$ cat verylonglogfile
==> Ctrl-S stops the listing, but I was unable to resume the output

Note that if instead of using puttycyg I execute cat verylonglogfile in a 
"normal" Cygwin (i.e. Windows CMD), everything is working fine although the 
pause is slightly delayed, maybe due to buffered output.

Original comment by dre...@gmail.com on 15 Jun 2011 at 2:20

GoogleCodeExporter commented 8 years ago
It's also worth mentioning that the hung job show up as "waiting to output":

$ ps
      PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
O    3184       1    3184       3184    0 191995 15:58:54 /c/Program 
Files/PuTTY/cthelper
     5784    3184    5784       5568    1 191995 15:58:54 /usr/bin/bash
O    5572    5784    5572       4868    1 191995 16:00:04 /usr/bin/cat
     3268       1    3268       3268    4 191995 16:20:52 /c/Program Files/PuTTY/cthelper
     2844    3268    2844       5484    7 191995 16:20:52 /usr/bin/bash
     5072    2844    5072       2444    7 191995 16:20:54 /usr/bin/ps

Cygwin version CYGWIN_NT-5.1 1.7.9(0.237/5/3)
PuttyCyg 20101029

Original comment by dre...@gmail.com on 15 Jun 2011 at 2:27

GoogleCodeExporter commented 8 years ago
(Cheers to Google's clunky Google Apps migration which kept me from seeing 
responses here...)

I don't want to use a pager that I'll have to step through the output a page at 
a time.  I want the log output displayed on its own, all the time, and be able 
to pause the output from time to time to read or copy text.

CYGWIN wasn't set to anything, but setting it to "tty" didn't have any visible 
effect.

^S does work when I run a Cygwin binary, eg. find, but not in general (in my 
immediate case, adb logcat).

Original comment by gl...@zewt.org on 1 Sep 2011 at 3:51