public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Strange "mouse" behavior in mintty
@ 2012-08-13 13:44 Ryan Johnson
  2012-08-14  2:21 ` Herbert Stocker
  0 siblings, 1 reply; 5+ messages in thread
From: Ryan Johnson @ 2012-08-13 13:44 UTC (permalink / raw)
  To: cygwin

Hi all,

I'm hitting  a mouse-related (?) problem with mintty in non-mouse mode.

STC A: Log into a remote machine, invoke `sleep 10', and -- during the 
wait --- click anywhere on the line containing the cursor.

STC B: Open tinyirc and click anywhere on the text entry line at the bottom

Both cases will insert a long string like this: 
^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C (only about 4x longer)

I suspect this is a problem with the way mintty tries to be helpful with 
the mouse when the app's not mouse-aware. Running STC A on a local 
mintty/bash sesson will place the cursor wherever you clicked, which 
while harmless is arguably incorrect (and probably the source of troubles).

Any ideas?
Ryan




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Strange "mouse" behavior in mintty
  2012-08-13 13:44 Strange "mouse" behavior in mintty Ryan Johnson
@ 2012-08-14  2:21 ` Herbert Stocker
  2012-08-14  5:38   ` Ryan Johnson
  0 siblings, 1 reply; 5+ messages in thread
From: Herbert Stocker @ 2012-08-14  2:21 UTC (permalink / raw)
  To: cygwin

Hi Ryan,

On 13.08.2012 15:33, Ryan Johnson wrote:
> Hi all,
>
> I'm hitting  a mouse-related (?) problem with mintty in non-mouse mode.
>
> STC A: Log into a remote machine, invoke `sleep 10', and -- during the 
> wait --- click anywhere on the line containing the cursor.
>
> STC B: Open tinyirc and click anywhere on the text entry line at the 
> bottom
>
> Both cases will insert a long string like this: 
> ^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C (only about 4x 
> longer)
Did you notice that when you click somewhere in the command line, the 
cursor moves
to that position? i think it has to do with that.

Go to the options dialog, select "Mouse" and uncheck "Clicks place 
command line cursor".
The effect should go away.

Herbert


> I suspect this is a problem with the way mintty tries to be helpful 
> with the mouse when the app's not mouse-aware. Running STC A on a 
> local mintty/bash sesson will place the cursor wherever you clicked, 
> which while harmless is arguably incorrect (and probably the source of 
> troubles).
>
> Any ideas?
> Ryan
>
>
>
>
> -- 
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Strange "mouse" behavior in mintty
  2012-08-14  2:21 ` Herbert Stocker
@ 2012-08-14  5:38   ` Ryan Johnson
  2012-08-29 19:50     ` Andy Koppe
  0 siblings, 1 reply; 5+ messages in thread
From: Ryan Johnson @ 2012-08-14  5:38 UTC (permalink / raw)
  To: cygwin

On 13/08/2012 10:04 PM, Herbert Stocker wrote:
> Hi Ryan,
>
> On 13.08.2012 15:33, Ryan Johnson wrote:
>> Hi all,
>>
>> I'm hitting  a mouse-related (?) problem with mintty in non-mouse mode.
>>
>> STC A: Log into a remote machine, invoke `sleep 10', and -- during 
>> the wait --- click anywhere on the line containing the cursor.
>>
>> STC B: Open tinyirc and click anywhere on the text entry line at the 
>> bottom
>>
>> Both cases will insert a long string like this: 
>> ^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C (only about 4x 
>> longer)
> Did you notice that when you click somewhere in the command line, the 
> cursor moves
> to that position? i think it has to do with that.
>
> Go to the options dialog, select "Mouse" and uncheck "Clicks place 
> command line cursor".
> The effect should go away.
Yes, that's the feature I was saying is probably related (see quote 
below). I don't want to disable it because it's immensely useful... I 
just don't want it dumping a mountain of ^[[C escapes at odd times.

Poking around in terminfo docs says CSI C is a "non-destructive move 
right" ("cuf1" in terminfo parlance). Sounds like exactly the right 
thing to send, but I guess shells (or curses apps) that don't correctly 
handle cuf1 would give this behavior... though I'm surprised that 
cygwin's bash can handle it and linux can't, especially when it works 
during normal line editing. Or maybe it's ssh... my sshd won't run right 
now so I can't test that hypothesis.

Ryan


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Strange "mouse" behavior in mintty
  2012-08-14  5:38   ` Ryan Johnson
@ 2012-08-29 19:50     ` Andy Koppe
  2012-08-29 20:12       ` Ryan Johnson
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Koppe @ 2012-08-29 19:50 UTC (permalink / raw)
  To: cygwin

On 14 August 2012 04:43, Ryan Johnson wrote:
> On 13/08/2012 10:04 PM, Herbert Stocker wrote:
>>
>> Hi Ryan,
>>
>> On 13.08.2012 15:33, Ryan Johnson wrote:
>>>
>>> Hi all,
>>>
>>> I'm hitting  a mouse-related (?) problem with mintty in non-mouse mode.
>>>
>>> STC A: Log into a remote machine, invoke `sleep 10', and -- during the
>>> wait --- click anywhere on the line containing the cursor.
>>>
>>> STC B: Open tinyirc and click anywhere on the text entry line at the
>>> bottom
>>>
>>> Both cases will insert a long string like this:
>>> ^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C (only about 4x longer)
>>
>> Did you notice that when you click somewhere in the command line, the
>> cursor moves
>> to that position? i think it has to do with that.
>>
>> Go to the options dialog, select "Mouse" and uncheck "Clicks place command
>> line cursor".
>> The effect should go away.
>
> Yes, that's the feature I was saying is probably related (see quote below).
> I don't want to disable it because it's immensely useful... I just don't
> want it dumping a mountain of ^[[C escapes at odd times.

The feature is a hack, which is why it's off by default. Mintty simply
sends the number of arrow left/right keypresses that it thinks should
take the cursor to the right position, whereby ^[[C is the keycode for
arrow right. Obviously this relies on the application handling such
keypresses in the expected way.

However, are you finding that the arrow keys work where the mouse
feature doesn't? I think there is a problem with mintty here actually,
in that it doesn't take account of application cursor key mode when
sending those mouse events. (In that mode, the arrow left/right
keycodes change to ^[OD and ^[OC.)

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: Strange "mouse" behavior in mintty
  2012-08-29 19:50     ` Andy Koppe
@ 2012-08-29 20:12       ` Ryan Johnson
  0 siblings, 0 replies; 5+ messages in thread
From: Ryan Johnson @ 2012-08-29 20:12 UTC (permalink / raw)
  To: cygwin

On 29/08/2012 3:15 PM, Andy Koppe wrote:
> On 14 August 2012 04:43, Ryan Johnson wrote:
>> On 13/08/2012 10:04 PM, Herbert Stocker wrote:
>>> Hi Ryan,
>>>
>>> On 13.08.2012 15:33, Ryan Johnson wrote:
>>>> Hi all,
>>>>
>>>> I'm hitting  a mouse-related (?) problem with mintty in non-mouse mode.
>>>>
>>>> STC A: Log into a remote machine, invoke `sleep 10', and -- during the
>>>> wait --- click anywhere on the line containing the cursor.
>>>>
>>>> STC B: Open tinyirc and click anywhere on the text entry line at the
>>>> bottom
>>>>
>>>> Both cases will insert a long string like this:
>>>> ^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C^[[C (only about 4x longer)
>>> Did you notice that when you click somewhere in the command line, the
>>> cursor moves
>>> to that position? i think it has to do with that.
>>>
>>> Go to the options dialog, select "Mouse" and uncheck "Clicks place command
>>> line cursor".
>>> The effect should go away.
>> Yes, that's the feature I was saying is probably related (see quote below).
>> I don't want to disable it because it's immensely useful... I just don't
>> want it dumping a mountain of ^[[C escapes at odd times.
> The feature is a hack, which is why it's off by default. Mintty simply
> sends the number of arrow left/right keypresses that it thinks should
> take the cursor to the right position, whereby ^[[C is the keycode for
> arrow right. Obviously this relies on the application handling such
> keypresses in the expected way.
Fair enough. Perhaps we could have a mintty-specific escape so users can 
selectively disable it for those apps (like tinyirc) where it's a 
problem? Hack or not, I really like the feature and don't want to 
disable it globally.

> However, are you finding that the arrow keys work where the mouse
> feature doesn't? I think there is a problem with mintty here actually,
> in that it doesn't take account of application cursor key mode when
> sending those mouse events. (In that mode, the arrow left/right
> keycodes change to ^[OD and ^[OC.)
I don't think arrow keys are recognized in either case: bash wouldn't 
process them until the command it's running completes, and tinyirc is 
not mouse-enabled AFAIK (it uses curses directly rather than the more 
sensible libreadline). But it does seem that ^[OC would be more 
appropriate to send in app mode.

Ryan


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2012-08-29 19:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-13 13:44 Strange "mouse" behavior in mintty Ryan Johnson
2012-08-14  2:21 ` Herbert Stocker
2012-08-14  5:38   ` Ryan Johnson
2012-08-29 19:50     ` Andy Koppe
2012-08-29 20:12       ` Ryan Johnson

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).