public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Disabling focus reporting in mintty
@ 2013-08-26 20:54 John Koelndorfer
  2013-08-26 21:09 ` Thomas Wolff
  0 siblings, 1 reply; 5+ messages in thread
From: John Koelndorfer @ 2013-08-26 20:54 UTC (permalink / raw)
  To: cygwin

I seem to have run into some trouble with focus reporting in mintty
1.1.2 and tmux 1.8 running on a remote Arch Linux host.  tmux does not
seem to catch the focus reporting control characters properly and will
allow the "^[[O" and "^[[I" to bleed through to applications.  Here is
how I have tested this:

1.  Connect to remote host over ssh.
2.  Run `cat'.
3. Click on the mintty taskbar entry repeatedly.  Note that there are
no control characters showing up.

Now, I repeat the above steps, but before running cat, I launched a
tmux session using `tmux'.

Now, when I click the mintty taskbar, I see:

^[[O^[[I

repeatedly.  In other applications things will manifest differently,
but my issue is specifically with irssi where "[I" shows up in the
input box every time I focus mintty, which is quite annoying.

In order to try and mitigate this issue, I attempted to echo ^[[?1004l
per http://code.google.com/p/mintty/wiki/Changes (under version
0.4.1).  Exact steps were:

1. Launch mintty.
2. Run `cat' locally.
3. Press "ESC [ ? 1 0 0 4 l", followed by ^D.  I believe this should
echo the correct control sequence, can someone confirm?  Nothing shows
up on stdout from cat, so it appears mintty is indeed interpreting
this as a control sequence.
4. Connect to same remote host, run tmux and cat as described before.
5. Focus and unfocus mintty by clicking the taskbar entry.

However, the above steps still show the focus reporting control
characters bleeding through to cat.

Am I going about disabling focus reporting correctly?  Should it do
what I think it should be doing?  Is there some other solution that I
might be missing?

Thanks in advance for any insight you can provide!

--
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: Disabling focus reporting in mintty
  2013-08-26 20:54 Disabling focus reporting in mintty John Koelndorfer
@ 2013-08-26 21:09 ` Thomas Wolff
  2013-08-27 12:52   ` John Koelndorfer
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Wolff @ 2013-08-26 21:09 UTC (permalink / raw)
  To: cygwin

Am 26.08.2013 22:54, schrieb John Koelndorfer:
> I seem to have run into some trouble with focus reporting in mintty
> 1.1.2 and tmux 1.8 running on a remote Arch Linux host.  tmux does not
> seem to catch the focus reporting control characters properly and will
> allow the "^[[O" and "^[[I" to bleed through to applications.  Here is
> how I have tested this:
>
> 1.  Connect to remote host over ssh.
> 2.  Run `cat'.
> 3. Click on the mintty taskbar entry repeatedly.  Note that there are
> no control characters showing up.
>
> Now, I repeat the above steps, but before running cat, I launched a
> tmux session using `tmux'.
>
> Now, when I click the mintty taskbar, I see:
>
> ^[[O^[[I
>
> repeatedly.  In other applications things will manifest differently,
> but my issue is specifically with irssi where "[I" shows up in the
> input box every time I focus mintty, which is quite annoying.
>
> In order to try and mitigate this issue, I attempted to echo ^[[?1004l
> per http://code.google.com/p/mintty/wiki/Changes (under version
> 0.4.1).  Exact steps were:
>
> 1. Launch mintty.
> 2. Run `cat' locally.
> 3. Press "ESC [ ? 1 0 0 4 l", followed by ^D.  I believe this should
> echo the correct control sequence, can someone confirm?  Nothing shows
> up on stdout from cat, so it appears mintty is indeed interpreting
> this as a control sequence.
> 4. Connect to same remote host, run tmux and cat as described before.
> 5. Focus and unfocus mintty by clicking the taskbar entry.
>
> However, the above steps still show the focus reporting control
> characters bleeding through to cat.
>
> Am I going about disabling focus reporting correctly?  Should it do
> what I think it should be doing?  Is there some other solution that I
> might be missing?
Reading your report above, it seems tmux enables focus reporting (and 
doesn't handle it then...).
So as a workaround, you would need to disable it (sending that escape 
sequence) *after* you've started tmux, inside it.
--
Thomas

--
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: Disabling focus reporting in mintty
  2013-08-26 21:09 ` Thomas Wolff
@ 2013-08-27 12:52   ` John Koelndorfer
  2013-08-29  7:26     ` Thomas Wolff
  0 siblings, 1 reply; 5+ messages in thread
From: John Koelndorfer @ 2013-08-27 12:52 UTC (permalink / raw)
  To: cygwin

Thomas, thanks for the suggestion.  I thought I had tried that and
indeed, when I attempted to disable focus reporting within tmux there
wasn't any change.  I'd have to guess that tmux is intercepting the
control sequence and probably discarding it.  I don't know enough
about terminal emulation to say if that's a sane thing to do.

In any case, I'm told in #tmux on freenode that focus reporting can be
disabled in tmux 1.9, so it's just a matter of waiting for that
release (or building the latest sources).

Thanks again!

On Mon, Aug 26, 2013 at 4:09 PM, Thomas Wolff <towo@towo.net> wrote:
> Am 26.08.2013 22:54, schrieb John Koelndorfer:
>
>> I seem to have run into some trouble with focus reporting in mintty
>> 1.1.2 and tmux 1.8 running on a remote Arch Linux host.  tmux does not
>> seem to catch the focus reporting control characters properly and will
>> allow the "^[[O" and "^[[I" to bleed through to applications.  Here is
>> how I have tested this:
>>
>> 1.  Connect to remote host over ssh.
>> 2.  Run `cat'.
>> 3. Click on the mintty taskbar entry repeatedly.  Note that there are
>> no control characters showing up.
>>
>> Now, I repeat the above steps, but before running cat, I launched a
>> tmux session using `tmux'.
>>
>> Now, when I click the mintty taskbar, I see:
>>
>> ^[[O^[[I
>>
>> repeatedly.  In other applications things will manifest differently,
>> but my issue is specifically with irssi where "[I" shows up in the
>> input box every time I focus mintty, which is quite annoying.
>>
>> In order to try and mitigate this issue, I attempted to echo ^[[?1004l
>> per http://code.google.com/p/mintty/wiki/Changes (under version
>> 0.4.1).  Exact steps were:
>>
>> 1. Launch mintty.
>> 2. Run `cat' locally.
>> 3. Press "ESC [ ? 1 0 0 4 l", followed by ^D.  I believe this should
>> echo the correct control sequence, can someone confirm?  Nothing shows
>> up on stdout from cat, so it appears mintty is indeed interpreting
>> this as a control sequence.
>> 4. Connect to same remote host, run tmux and cat as described before.
>> 5. Focus and unfocus mintty by clicking the taskbar entry.
>>
>> However, the above steps still show the focus reporting control
>> characters bleeding through to cat.
>>
>> Am I going about disabling focus reporting correctly?  Should it do
>> what I think it should be doing?  Is there some other solution that I
>> might be missing?
>
> Reading your report above, it seems tmux enables focus reporting (and
> doesn't handle it then...).
> So as a workaround, you would need to disable it (sending that escape
> sequence) *after* you've started tmux, inside it.
> --
> Thomas
>
> --
> 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: Disabling focus reporting in mintty
  2013-08-27 12:52   ` John Koelndorfer
@ 2013-08-29  7:26     ` Thomas Wolff
  2013-09-03 13:01       ` John Koelndorfer
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Wolff @ 2013-08-29  7:26 UTC (permalink / raw)
  To: cygwin

Am 27.08.2013 14:52, schrieb John Koelndorfer:
> Thomas, thanks for the suggestion.  I thought I had tried that and
> indeed, when I attempted to disable focus reporting within tmux there
> wasn't any change.  I'd have to guess that tmux is intercepting the
> control sequence and probably discarding it.  I don't know enough
> about terminal emulation to say if that's a sane thing to do.
>
> In any case, I'm told in #tmux on freenode that focus reporting can be
> disabled in tmux 1.9, so it's just a matter of waiting for that
> release (or building the latest sources).
Hmm. I've just tried to reproduce the issue by compiling tmux 1.8 myself.
On my PPC/Debian system it supports focus reporting as expected and does 
not switch it on by default. It both passes through window focus and 
generates its own focus report if switching panes, but *only if* enabled 
in the respective pane.
I don't see any configuration option which could have affected that, either.
The behaviour you described cannot be observed; it could be observed, 
obviously, if you enable focus reporting explicitly, or run an 
application that does so (like my editor mined) and kill it with kill -9 
(so it cannot reset it).
Otherwise I don't observe your problem. Please check again, is there any 
other source of getting the reports enabled in your environment? Do you 
enable it in your .profile or .bashrc?
--
Thomas

>
> Thanks again!
>
> On Mon, Aug 26, 2013 at 4:09 PM, Thomas Wolff <towo@towo.net> wrote:
>> Am 26.08.2013 22:54, schrieb John Koelndorfer:
>>
>>> I seem to have run into some trouble with focus reporting in mintty
>>> 1.1.2 and tmux 1.8 running on a remote Arch Linux host.  tmux does not
>>> seem to catch the focus reporting control characters properly and will
>>> allow the "^[[O" and "^[[I" to bleed through to applications.  Here is
>>> how I have tested this:
>>>
>>> 1.  Connect to remote host over ssh.
>>> 2.  Run `cat'.
>>> 3. Click on the mintty taskbar entry repeatedly.  Note that there are
>>> no control characters showing up.
>>>
>>> Now, I repeat the above steps, but before running cat, I launched a
>>> tmux session using `tmux'.
>>>
>>> Now, when I click the mintty taskbar, I see:
>>>
>>> ^[[O^[[I
>>>
>>> repeatedly.  In other applications things will manifest differently,
>>> but my issue is specifically with irssi where "[I" shows up in the
>>> input box every time I focus mintty, which is quite annoying.
>>>
>>> In order to try and mitigate this issue, I attempted to echo ^[[?1004l
>>> per http://code.google.com/p/mintty/wiki/Changes (under version
>>> 0.4.1).  Exact steps were:
>>>
>>> 1. Launch mintty.
>>> 2. Run `cat' locally.
>>> 3. Press "ESC [ ? 1 0 0 4 l", followed by ^D.  I believe this should
>>> echo the correct control sequence, can someone confirm?  Nothing shows
>>> up on stdout from cat, so it appears mintty is indeed interpreting
>>> this as a control sequence.
>>> 4. Connect to same remote host, run tmux and cat as described before.
>>> 5. Focus and unfocus mintty by clicking the taskbar entry.
>>>
>>> However, the above steps still show the focus reporting control
>>> characters bleeding through to cat.
>>>
>>> Am I going about disabling focus reporting correctly?  Should it do
>>> what I think it should be doing?  Is there some other solution that I
>>> might be missing?
>> Reading your report above, it seems tmux enables focus reporting (and
>> doesn't handle it then...).
>> So as a workaround, you would need to disable it (sending that escape
>> sequence) *after* you've started tmux, inside it.
>> --
>> Thomas
>>
>> --
>> 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
>


--
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: Disabling focus reporting in mintty
  2013-08-29  7:26     ` Thomas Wolff
@ 2013-09-03 13:01       ` John Koelndorfer
  0 siblings, 0 replies; 5+ messages in thread
From: John Koelndorfer @ 2013-09-03 13:01 UTC (permalink / raw)
  To: cygwin

Thomas,

Thanks for your pointers.  The issue did indeed lie in my tmux
configuration, but it is confusing why it did not manifest itself
before.

When I created a completely new user account with no settings
whatsoever, tmux did not exhibit the issue I have been describing.  On
a whim, I blew away my tmux configuration and tried again (important
to note: if you have active tmux sessions, you must use a different
socket (-L option) to test a new configuration, or close your open
sessions).  When I eliminated my tmux configuration, the problem was
gone.

The only thing that looked incriminating was this line:
set -g escape-time 0

I set this to 0 because hitting escape would cause delays in e.g. vim
when escape was pressed.  See here:
http://superuser.com/questions/252214/slight-delay-when-switching-modes-in-vim-using-tmux-or-screen.
 As a compromise, I set the value to 100 instead of 0.  Problem
solved!

As I mentioned, I have never noticed this issue before.  The setting
has existed in my tmux configuration for several years, so I can only
conclude something must have changed recently in tmux.

Thanks for your help!

On Thu, Aug 29, 2013 at 2:26 AM, Thomas Wolff <towo@towo.net> wrote:
> Am 27.08.2013 14:52, schrieb John Koelndorfer:
>
>> Thomas, thanks for the suggestion.  I thought I had tried that and
>> indeed, when I attempted to disable focus reporting within tmux there
>> wasn't any change.  I'd have to guess that tmux is intercepting the
>> control sequence and probably discarding it.  I don't know enough
>> about terminal emulation to say if that's a sane thing to do.
>>
>> In any case, I'm told in #tmux on freenode that focus reporting can be
>> disabled in tmux 1.9, so it's just a matter of waiting for that
>> release (or building the latest sources).
>
> Hmm. I've just tried to reproduce the issue by compiling tmux 1.8 myself.
> On my PPC/Debian system it supports focus reporting as expected and does not
> switch it on by default. It both passes through window focus and generates
> its own focus report if switching panes, but *only if* enabled in the
> respective pane.
> I don't see any configuration option which could have affected that, either.
> The behaviour you described cannot be observed; it could be observed,
> obviously, if you enable focus reporting explicitly, or run an application
> that does so (like my editor mined) and kill it with kill -9 (so it cannot
> reset it).
> Otherwise I don't observe your problem. Please check again, is there any
> other source of getting the reports enabled in your environment? Do you
> enable it in your .profile or .bashrc?
> --
> Thomas
>
>
>>
>> Thanks again!
>>
>> On Mon, Aug 26, 2013 at 4:09 PM, Thomas Wolff <towo@towo.net> wrote:
>>>
>>> Am 26.08.2013 22:54, schrieb John Koelndorfer:
>>>
>>>> I seem to have run into some trouble with focus reporting in mintty
>>>> 1.1.2 and tmux 1.8 running on a remote Arch Linux host.  tmux does not
>>>> seem to catch the focus reporting control characters properly and will
>>>> allow the "^[[O" and "^[[I" to bleed through to applications.  Here is
>>>> how I have tested this:
>>>>
>>>> 1.  Connect to remote host over ssh.
>>>> 2.  Run `cat'.
>>>> 3. Click on the mintty taskbar entry repeatedly.  Note that there are
>>>> no control characters showing up.
>>>>
>>>> Now, I repeat the above steps, but before running cat, I launched a
>>>> tmux session using `tmux'.
>>>>
>>>> Now, when I click the mintty taskbar, I see:
>>>>
>>>> ^[[O^[[I
>>>>
>>>> repeatedly.  In other applications things will manifest differently,
>>>> but my issue is specifically with irssi where "[I" shows up in the
>>>> input box every time I focus mintty, which is quite annoying.
>>>>
>>>> In order to try and mitigate this issue, I attempted to echo ^[[?1004l
>>>> per http://code.google.com/p/mintty/wiki/Changes (under version
>>>> 0.4.1).  Exact steps were:
>>>>
>>>> 1. Launch mintty.
>>>> 2. Run `cat' locally.
>>>> 3. Press "ESC [ ? 1 0 0 4 l", followed by ^D.  I believe this should
>>>> echo the correct control sequence, can someone confirm?  Nothing shows
>>>> up on stdout from cat, so it appears mintty is indeed interpreting
>>>> this as a control sequence.
>>>> 4. Connect to same remote host, run tmux and cat as described before.
>>>> 5. Focus and unfocus mintty by clicking the taskbar entry.
>>>>
>>>> However, the above steps still show the focus reporting control
>>>> characters bleeding through to cat.
>>>>
>>>> Am I going about disabling focus reporting correctly?  Should it do
>>>> what I think it should be doing?  Is there some other solution that I
>>>> might be missing?
>>>
>>> Reading your report above, it seems tmux enables focus reporting (and
>>> doesn't handle it then...).
>>> So as a workaround, you would need to disable it (sending that escape
>>> sequence) *after* you've started tmux, inside it.
>>> --
>>> Thomas
>>>
>>> --
>>> 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
>>
>
>
> --
> 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

end of thread, other threads:[~2013-09-03 13:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-26 20:54 Disabling focus reporting in mintty John Koelndorfer
2013-08-26 21:09 ` Thomas Wolff
2013-08-27 12:52   ` John Koelndorfer
2013-08-29  7:26     ` Thomas Wolff
2013-09-03 13:01       ` John Koelndorfer

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