Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use cygwin at Windows XP.

There's problem with Mercurial, for example.

Say, I need to push my repo with several subrepos to the remote server. This operation takes about 20 seconds.

When I call hg from cmd.exe, I see all actions in real-time:

pushing subrepo ..... to .....
searching for changes

etc. Everything is fine.

But, when I call it from cygwin terminal, I type hg push, press Enter, and there's nothing echoed to the console for about 20 seconds, and then all the logs appear immediately.

Why is that, and how can I avoid that?

share|improve this question
    
The cygwin shell uses pipes to direct output which programs often assume are non-interactive (they don't see them as a TTY / console). The result is they often buffer output in 4k chunks for performance reasons. Have not seen a general solution to this. –  Brian Aug 4 '13 at 16:08
    
But, when I type, say, ping google.com, I see real-time action of it –  Dmitry Frank Aug 4 '13 at 17:14
    
Depends on the command / executable. Some always line buffer so won't be a problem. –  Brian Aug 4 '13 at 17:17
    
I use mercurial under cygwin, and I don't have the described problem. Is this a "native" Windows version of mercurial, or cygwin's version? If the former, try the latter. –  Heptite Aug 4 '13 at 19:57
    
This is a "native" Windows version, yes. It contains some useful features such as overlay icons and TortoiseHG GUI, cygwin's version seems not have them. Thanks for the suggestion, I'm out of my dev environment for several days, but I'll definitely try it later, anyway. –  Dmitry Frank Aug 4 '13 at 22:01

3 Answers 3

up vote 1 down vote accepted

I use mercurial under cygwin, and I don't have the described problem. Is this a "native" Windows version of mercurial, or cygwin's version? If the former, try the latter.

share|improve this answer

I know this is an old thread but I've experienced this issue for the past 3 years. And after about a month of it, i was coming apart at the seams and could take it no longer. It may be a little blunt, or heavy handed but it works...and has been working for 2.75 years without issue.

Here's what kept my laptop from winding up in the street

$ ln -s `where ping.exe | grep -v rh` /usr/bin/ping.exe

Here's how I arrived there...

david@Covet ~
$ which ping.exe
/usr/bin/ping.exe

david@Covet ~
$ /usr/bin/ping.exe
Usage:  ping [-dfqrv] host [packetsize [count [preload]]]

david@Covet ~
$ where ping.exe
C:\rhcygwin64\bin\ping.exe
C:\Windows\System32\PING.EXE

david@Covet ~
$ mv /usr/bin/ping.exe /usr/bin/cyping.exe

david@Covet ~
$ ln -s `where ping.exe | grep -v rh` /usr/bin/ping.exe

david@Covet ~
$ which ping
/usr/bin/ping

david@Covet ~
$ ping

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
            [-r count] [-s count] [[-j host-list] | [-k host-list]]
            [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name

Options:
    -t             Ping the specified host until stopped.
                   To see statistics and continue - type Control-Break;
                   To stop - type Control-C.
    -a             Resolve addresses to hostnames.
    -n count       Number of echo requests to send.
    -l size        Send buffer size.
    -f             Set Don't Fragment flag in packet (IPv4-only).
    -i TTL         Time To Live.
    -v TOS         Type Of Service (IPv4-only. This setting has been deprecated
                   and has no effect on the type of service field in the IP Header).
    -r count       Record route for count hops (IPv4-only).
    -s count       Timestamp for count hops (IPv4-only).
    -j host-list   Loose source route along host-list (IPv4-only).
    -k host-list   Strict source route along host-list (IPv4-only).
    -w timeout     Timeout in milliseconds to wait for each reply.
    -R             Use routing header to test reverse route also (IPv6-only).
    -S srcaddr     Source address to use.
    -4             Force using IPv4.
    -6             Force using IPv6.

david@Covet ~
$ ping -t 8.8.8.8

Pinging 8.8.8.8 with 32 bytes of data:
Reply from 8.8.8.8: bytes=32 time=13ms TTL=54
Reply from 8.8.8.8: bytes=32 time=13ms TTL=54
Reply from 8.8.8.8: bytes=32 time=13ms TTL=54
Reply from 8.8.8.8: bytes=32 time=13ms TTL=54
Reply from 8.8.8.8: bytes=32 time=13ms TTL=54
Reply from 8.8.8.8: bytes=32 time=14ms TTL=54
Reply from 8.8.8.8: bytes=32 time=14ms TTL=54


david@Covet ~
$

I hope this helps someone, anyone like it's helped me.

share|improve this answer

I know when implementing command line code in C/C++ this behavior can be controlled by the fflush() command to flush an output buffer, fclose() would do the same thing.

So, it's dependent on the program you're running and how often they flush().

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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