public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Terminal occasionally shows duplicate command text when it is split over multiple lines
       [not found] <1966566714.1219564.1629755526730.ref@mail.yahoo.com>
@ 2021-08-23 21:52 ` Ray Satiro
  2021-08-23 22:15   ` Thomas Wolff
  2021-08-24  1:20   ` C Linus Hicks
  0 siblings, 2 replies; 6+ messages in thread
From: Ray Satiro @ 2021-08-23 21:52 UTC (permalink / raw)
  To: cygwin

I'm using cygwin x86 updated yesterday and when I paste in commands that are split over multiple lines sometimes an arbitrary line will show more than once, even though it is not actually part of the command more than once. For example here's a command:

echo foo \bar \baz \qux

And here's the terminal output when I paste it in:

$ echo foo \qux
> bar \> baz \> quxfoo bar baz qux

$ echo foo \baz \> bar \> baz \> quxfoo bar baz qux

My terminal is mintty 3.5.0 (i686-pc-cygwin). I'm not sure if this is a cygwin issue or mintty issue.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Terminal occasionally shows duplicate command text when it is split over multiple lines
  2021-08-23 21:52 ` Terminal occasionally shows duplicate command text when it is split over multiple lines Ray Satiro
@ 2021-08-23 22:15   ` Thomas Wolff
  2021-08-25  6:42     ` Ray Satiro
  2021-08-24  1:20   ` C Linus Hicks
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Wolff @ 2021-08-23 22:15 UTC (permalink / raw)
  To: cygwin

Am 23.08.2021 um 23:52 schrieb Ray Satiro via Cygwin:
> I'm using cygwin x86 updated yesterday and when I paste in commands that are split over multiple lines sometimes an arbitrary line will show more than once, even though it is not actually part of the command more than once. For example here's a command:
>
> echo foo \bar \baz \qux
>
> And here's the terminal output when I paste it in:
>
> $ echo foo \qux
>> bar \> baz \> quxfoo bar baz qux
> $ echo foo \baz \> bar \> baz \> quxfoo bar baz qux
Please provide a clear test case. How exactly would your clipboard have 
multiple lines? Your example is only one line.

> My terminal is mintty 3.5.0 (i686-pc-cygwin). I'm not sure if this is a cygwin issue or mintty issue.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Terminal occasionally shows duplicate command text when it is split over multiple lines
  2021-08-23 21:52 ` Terminal occasionally shows duplicate command text when it is split over multiple lines Ray Satiro
  2021-08-23 22:15   ` Thomas Wolff
@ 2021-08-24  1:20   ` C Linus Hicks
  1 sibling, 0 replies; 6+ messages in thread
From: C Linus Hicks @ 2021-08-24  1:20 UTC (permalink / raw)
  To: Ray Satiro, cygwin

On Mon, 2021-08-23 at 21:52 +0000, Ray Satiro via Cygwin wrote:
> I'm using cygwin x86 updated yesterday and when I paste in commands that are split over multiple lines sometimes an arbitrary line will show more than once, even though it is not actually part of the command more than once. For example here's a command:
> 
> echo foo \bar \baz \qux
> 
> And here's the terminal output when I paste it in:
> 
> $ echo foo \qux
> > bar \> baz \> quxfoo bar baz qux
> 
> $ echo foo \baz \> bar \> baz \> quxfoo bar baz qux
> 
> My terminal is mintty 3.5.0 (i686-pc-cygwin). I'm not sure if this is a cygwin issue or mintty issue.
> 

I have seen this before too, but from my experience, only the display of the text is incorrect, what
ends up in the buffer accurately reflects what you pasted. It's just an artifact of the way
characters are read and echoed. If you recall the text from your command history, is it correct?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Terminal occasionally shows duplicate command text when it is split over multiple lines
  2021-08-23 22:15   ` Thomas Wolff
@ 2021-08-25  6:42     ` Ray Satiro
  2021-08-25 13:46       ` Thomas Wolff
  0 siblings, 1 reply; 6+ messages in thread
From: Ray Satiro @ 2021-08-25  6:42 UTC (permalink / raw)
  To: cygwin

On 8/23/2021 6:15 PM, Thomas Wolff wrote:
> Am 23.08.2021 um 23:52 schrieb Ray Satiro via Cygwin:
>> I'm using cygwin x86 updated yesterday and when I paste in commands
>> that are split over multiple lines sometimes an arbitrary line will
>> show more than once, even though it is not actually part of the
>> command more than once. For example here's a command:
>>
>> echo foo \bar \baz \qux
>>
>> And here's the terminal output when I paste it in:
>>
>> $ echo foo \qux
>>> bar \> baz \> quxfoo bar baz qux
>> $ echo foo \baz \> bar \> baz \> quxfoo bar baz qux
> Please provide a clear test case. How exactly would your clipboard
> have multiple lines? Your example is only one line. 


My mail client did that. Here I'll try again:

echo foo \
bar \
baz \
qux


$ echo foo \
baz \
qux
> bar \
> baz \
> qux
foo bar baz qux


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Terminal occasionally shows duplicate command text when it is split over multiple lines
  2021-08-25  6:42     ` Ray Satiro
@ 2021-08-25 13:46       ` Thomas Wolff
  2021-08-27 10:18         ` Andrey Repin
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Wolff @ 2021-08-25 13:46 UTC (permalink / raw)
  To: cygwin



Am 25.08.2021 um 08:42 schrieb Ray Satiro via Cygwin:
> On 8/23/2021 6:15 PM, Thomas Wolff wrote:
>> Am 23.08.2021 um 23:52 schrieb Ray Satiro via Cygwin:
>>> I'm using cygwin x86 updated yesterday and when I paste in commands
>>> that are split over multiple lines sometimes an arbitrary line will
>>> show more than once, even though it is not actually part of the
>>> command more than once. For example here's a command:
>>>
>>> echo foo \bar \baz \qux
>>>
>>> And here's the terminal output when I paste it in:
>>>
>>> $ echo foo \qux
>>>> bar \> baz \> quxfoo bar baz qux
>>> $ echo foo \baz \> bar \> baz \> quxfoo bar baz qux
>> Please provide a clear test case. How exactly would your clipboard
>> have multiple lines? Your example is only one line.
>
> My mail client did that. Here I'll try again:
>
> echo foo \
> bar \
> baz \
> qux
>
>
> $ echo foo \
> baz \
> qux
>> bar \
>> baz \
>> qux
> foo bar baz qux
>
>
Cannot reproduce this with mouse-pasting (middle mouse button). It does 
occur occasionally when pasting with Shift+Insert at keyboard repeat 
rate. I guess it's some kind of race condition, the initial part may get 
output earlier than the further parts are echoed. So it would not be a 
terminal issue.
Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Terminal occasionally shows duplicate command text when it is split over multiple lines
  2021-08-25 13:46       ` Thomas Wolff
@ 2021-08-27 10:18         ` Andrey Repin
  0 siblings, 0 replies; 6+ messages in thread
From: Andrey Repin @ 2021-08-27 10:18 UTC (permalink / raw)
  To: Thomas Wolff, cygwin

Greetings, Thomas Wolff!

>> My mail client did that. Here I'll try again:
>>
>> echo foo \
>> bar \
>> baz \
>> qux
>>
>>
>> $ echo foo \
>> baz \
>> qux
>>> bar \
>>> baz \
>>> qux
>> foo bar baz qux
>>
>>
> Cannot reproduce this with mouse-pasting (middle mouse button). It does 
> occur occasionally when pasting with Shift+Insert at keyboard repeat 
> rate. I guess it's some kind of race condition, the initial part may get 
> output earlier than the further parts are echoed. So it would not be a 
> terminal issue.

Similar issue can be sometimes observed when you only start terminal and begin
typing before the program (i.e. shell) is ready to accept input.
Some characters will appear before the shell prompt (in example), and repeated
in the prompt like you would expect.

So, this is indeed a race condition between terminal and the program running
in it, but a harmless one.


-- 
With best regards,
Andrey Repin
Friday, August 27, 2021 13:16:32

Sorry for my terrible english...


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-27 10:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1966566714.1219564.1629755526730.ref@mail.yahoo.com>
2021-08-23 21:52 ` Terminal occasionally shows duplicate command text when it is split over multiple lines Ray Satiro
2021-08-23 22:15   ` Thomas Wolff
2021-08-25  6:42     ` Ray Satiro
2021-08-25 13:46       ` Thomas Wolff
2021-08-27 10:18         ` Andrey Repin
2021-08-24  1:20   ` C Linus Hicks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).