Closed ikandaswamy closed 8 years ago
Assuming your copy-and-paste left out newlines and the last line on the screen is correct, this is an unfixable race condition. This happens when you shrink your window just as liner is repainting the line (even if the repaint is due to a previous shrink). The terminal emulator causes an implicit scroll when output reaches the end of the line. There's not much liner can do about this without becoming a full screen system. See also the WINCH comments in #59
If your output looks exactly like the above (a mishmash on a single line), then that is a bug. Please let me know what terminal emulator you are using.
The output looks exactly like the above. It is all on a single line. I am using the terminal application on Mac. Version 2.6.1 (361.1). $ echo $TERM xterm-256color
Below is the non edited output that i get.
Iks-MacBook-Pro:temptest ik$ ./temptest What is your name? {is isWhat is your name? {s mWhat is your name?What is your name?What is your namWhat is your naWhat What is your name?What is your name? This isWhat is your name? TWhat is yourWhat is yoWhatWhatWhWhWhatWhWhWhWhWhWhatWhatWhatWhWhWhat is your name? This is my name 2016/03/14 08:30:51 Got: This is my name Iks-MacBook-Pro:temptest ik$
I upgraded my iMac to Ubuntu after Apple prematurely discontinued support for it. I'll take a look this bug it the next time I have access to MacOS, if you don't send a pull request first.
I was unable to reproduce the issue described. The bottom line was always the correct prompt in my tests.
However, it was far too easy to produce garbage when resizing Terminal.app. I've added an extra space of padding to reduce (not eliminate; there will always be a race condition) the chance of Terminal.app deciding to wrap the line before we can redraw it.
I've also added a space on Windows, because (unlike ConEmu and Console2 on Windows 7) the Windows 10 Command Prompt needs the extra space.
Thanks again for the report.
Hi,
I was running the sample example provided and when i resized my screen while typing out the answer, the following happened ->
$ ./temptest What is your name? ueshaaWhat is your name? {haaWhat is your name? {aWhat is your name? What is your nameWhat is your naWhat iWhat iWhat iWhat iWhat iWhat iWhat iWhat iWhat iWhWhat is your name? uWhat is your name? uWhat is your namWhatWhatWhWhWhatWhat iWhat is yoWhat is your name? uesWhat is yourWhat is your name? uesWhat is What is your nWhat iWhWhWhWhat is your name? ueshaa
Is this a bug ?
Thanks Ik