From: Albrecht S. <vms...@go...> - 2011-08-11 14:05:24
|
On 10.08.2011 20:34, Andy Koppe wrote: > On 10 August 2011 12:52, Albrecht Schlosser wrote: >> I can reproduce the strange behavior/bug with this simple >> command line: >> >> for n in `seq -w 1 115`;do echo "$n 67890123456789012345678901";done >> >> What I see when using mintty with MinGW is something like >> this (elided *correct* lines and shortened): >> >> $ for n in `seq -w 1 115`;do echo "$n 67890123456789012345678901";done >> 001 67890123456789012345678901 >> 002 67890123456789012345678901 >> ... >> 015 67890123456789012345678901 >> 016 67890123456789012345678901 >> >> 17 67890123456789012345678901 >> 018 67890123456789012345678901 >> 019 67890123456789012345678901 >> ... >> 047 67890123456789012345678901 >> 048 67890123456789012345678901 >> >> 49 67890123456789012345678901 >> 050 67890123456789012345678901 >> 051 67890123456789012345678901 >> ... >> 079 67890123456789012345678901 >> 080 67890123456789012345678901 >> >> and so on. ... > This happens in rxvt too, except only half as often. I think this is > because mintty passes a 512-byte buffer when reading from the pseudo > terminal device, whereas rxvt passes a 1024 byte buffer. Looking at > --log output from mintty confirms that the missing '0's were replaced > with newlines. > > Since both mintty and rxvt are fine in Cygwin, I'm pointing the finger > of suspicion at the MSYS DLL's pseudo terminal device driver, in > particular at its implementation of the ONLCR termios option for > turning NLs into CR/NL pairs. Thanks, Andy, for testing and this interesting information. Indeed, switching off ONLCR shows no stripped/replaced characters anymore. $ stty -onlcr $ for n in `seq -w 1 115`;do echo "$n 67890123456789012345678901";done shows everything okay, no missing characters, however with a weird formatting due to missing <cr> characters. So, here are the next questions: - is it time to file a bug report? - if yes, where ? Or does anybody feel inclined to fix this w/o an explicit bug report? BTW.: Of course this bug does not only happen when writing such fixed size lines, but this was a simple reproducer. I saw the bug before from time to time with all sorts of longer output, e.g. directories, find, diffs, etc.. Thanks for reading so far... -- Regards, Albrecht |