Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-12 Thread Leonardo Brondani Schenkel
On 09/05/15 12:12, Nicholas Marriott wrote:
> On Sat, May 09, 2015 at 11:38:09AM +0200, Leonardo Brondani Schenkel wrote:
>> Makes perfect sense. However, since I get ^[[D or ^[OD in cat, where did
>> KEYC_ESCAPE go? Shouldn't I be getting ^[^[[D or ^[^[OD instead? What am
>> I missing here? It looks to me that I'm pressing Alt/Option+Left in the
>> terminal but the app is receiving just a Left, and the Alt went missing.
> 
> This doesn't seem to be the case, from your logs:
> 
> keys are 2 (^[b)
> complete key ^[b 0x301f
> writing key 0x301f
> found key 0x301f: "^[[D"
> 
> This shows tmux found ^[[D for 0x1f (the key is looked for without the
> modifiers).
> 
> Then:
> 
> input_parse: '^' ground
> input_parse: '[' ground
> input_parse: '^' ground
> input_parse: '[' ground
> input_parse: '[' ground
> input_parse: 'D' ground
> 
> input_parse is logging what tmux receives from the terminal, in this
> case it is "cat" printing "^[^[[D".
> 
> So the additional ^[ was sent to the terminal, and cat echoed it.

I re-checked and you're totally right; my memory failed me.

Thanks for your patience in explaining this. Now I have a much better
understanding of the key translation behavior performed by tmux.

(I also found it weird that kLFT3 is compiled in the binary terminfo
database and "infocmp -x" doesn't show it, but that's off-topic for this
list.)

// Leonardo.


--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-09 Thread Nicholas Marriott

...
> 
> input_parse is logging what tmux receives from the terminal, in this
> case it is "cat" printing "^[^[[D".
> 
> So the additional ^[ was sent to the terminal, and cat echoed it.

When I say terminal here I mean the pty inside tmux pane of course, not
the terminal emulator outside tmux.

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-09 Thread Nicholas Marriott
On Sat, May 09, 2015 at 11:38:09AM +0200, Leonardo Brondani Schenkel wrote:
> On 07/05/2015 13:48, Nicholas Marriott wrote:
> > +tmux-users
> > 
> > 
> > On Thu, May 07, 2015 at 10:01:03AM +0100, Nicholas Marriott wrote:
> >> Hi
> >>
> >> Well that explains it, since you have kLFT3=\Eb tmux will send M-Left
> >> instead of M-b for \Eb (and Option+Left since your terminal sends \Eb
> >> for that too).
> 
> All right, so just to make sure that I understand the logic...
> 
> When TERM is 'xterm-256color':
> 1. tmux receives an \Eb from the terminal
> 2. tmux does not recognize the sequence (not in terminfo)
> 3. tmux forwards this sequence "as is" to the application

Almost. tmux recognises this as M-b:

keys are 2 (^[b)
complete key ^[b 0x2062
writing key 0x2062

0x2062 is 0x2000 (Meta) + 0x62 (b).

It isn't sent as-is (there is still a translate step), it just has that
effect.

> 
> When TERM is 'nsterm':
> 1. tmux receives an \Eb from the terminal
> 2. tmux notices that \Eb is kLFT3 (Alt+Left) in terminfo
> 3. tmux translates Alt+Left into KEYC_LEFT|KEYC_ESCAPE (tty-keys.c)
> 4. tmux KEYC_LEFT is ^[[D or ^[OD, depending on the mode
> 5. tmux sends KEYC_LEFT|KEYC_ESCAPE to the application

Yes this is right.

> Makes perfect sense. However, since I get ^[[D or ^[OD in cat, where did
> KEYC_ESCAPE go? Shouldn't I be getting ^[^[[D or ^[^[OD instead? What am
> I missing here? It looks to me that I'm pressing Alt/Option+Left in the
> terminal but the app is receiving just a Left, and the Alt went missing.

This doesn't seem to be the case, from your logs:

keys are 2 (^[b)
complete key ^[b 0x301f
writing key 0x301f
found key 0x301f: "^[[D"

This shows tmux found ^[[D for 0x1f (the key is looked for without the
modifiers).

Then:

input_parse: '^' ground
input_parse: '[' ground
input_parse: '^' ground
input_parse: '[' ground
input_parse: '[' ground
input_parse: 'D' ground

input_parse is logging what tmux receives from the terminal, in this
case it is "cat" printing "^[^[[D".

So the additional ^[ was sent to the terminal, and cat echoed it.

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-09 Thread Leonardo Brondani Schenkel
On 07/05/2015 13:48, Nicholas Marriott wrote:
> +tmux-users
> 
> 
> On Thu, May 07, 2015 at 10:01:03AM +0100, Nicholas Marriott wrote:
>> Hi
>>
>> Well that explains it, since you have kLFT3=\Eb tmux will send M-Left
>> instead of M-b for \Eb (and Option+Left since your terminal sends \Eb
>> for that too).

All right, so just to make sure that I understand the logic...

When TERM is 'xterm-256color':
1. tmux receives an \Eb from the terminal
2. tmux does not recognize the sequence (not in terminfo)
3. tmux forwards this sequence "as is" to the application

When TERM is 'nsterm':
1. tmux receives an \Eb from the terminal
2. tmux notices that \Eb is kLFT3 (Alt+Left) in terminfo
3. tmux translates Alt+Left into KEYC_LEFT|KEYC_ESCAPE (tty-keys.c)
4. tmux KEYC_LEFT is ^[[D or ^[OD, depending on the mode
5. tmux sends KEYC_LEFT|KEYC_ESCAPE to the application

Makes perfect sense. However, since I get ^[[D or ^[OD in cat, where did
KEYC_ESCAPE go? Shouldn't I be getting ^[^[[D or ^[^[OD instead? What am
I missing here? It looks to me that I'm pressing Alt/Option+Left in the
terminal but the app is receiving just a Left, and the Alt went missing.

// Leonardo.

>>
>>
>>
>> On Thu, May 07, 2015 at 10:51:52AM +0200, Leonardo Brondani Schenkel wrote:
>>> On 07/05/15 09:58, Nicholas Marriott wrote:
 "new key ^[b: 0x301f (M-Left)"
 Are you sure your tmux is unmodified?
>>>
>>> It's the version available on MacPorts. As far as I can see it does not
>>> patch tmux in any significant way:
>>> https://trac.macports.org/browser/trunk/dports/sysutils/tmux?rev=132936
>>>
>>> Actually tmux 2.0 just landed in MacPorts but I didn't install it yet.
>>> I can upgrade to it and repeat the experiment if it might help.
>>>
 Did you use "infocmp -x" when dumping the terminfo entries you sent? If
 not, try "infocmp -x nsterm" and look for kLFT3.
>>>
>>> No, sorry, I overlooked that and didn't use "-x". The output with "-x"
>>> is listed below. kLFT3 is not there, but I checked my terminfo sources
>>> (I'm using a custom ~/.terminfo compiled from the latest database:
>>> version 1.536) and KLFT3 *is* present (in fact I was the one who
>>> actually suggested these new capabilities/entries in the ncurses mailing
>>> list in the first place):
>>>
>>> nsterm-build326|Terminal.app in OS X 10.9,
>>> kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, kcbt=\E[Z,
>>> kf18=\E[32~, kDC5=\E[3;5~, kDC7=\E[3;5~, kLFT3=\Eb,
>>> kLFT5=\E[1;5D, kRIT3=\Ef, kRIT5=\E[1;5C,
>>> use=nsterm-256color,
>>> # actually "343.7"
>>> nsterm-build343|Terminal.app in OS X 10.10,
>>> kend=\EOF, khome=\EOH, use=nsterm-build326,
>>> # This is an alias which should always point to the "current" version
>>> nsterm|Apple_Terminal|AppKit Terminal.app,
>>> use=nsterm-build343,
>>>
>>>
>>> $ infocmp -x
>>> #   Reconstructed via infocmp from file:
>>> /Users/Leonardo/.local/share/terminfo/6e/nsterm
>>> nsterm|Apple_Terminal|AppKit Terminal.app,
>>> am, bce, hs, mir, msgr, npc, xenl, xon,
>>> colors#256, cols#80, it#8, lines#24, pairs#32767, wsl#50,
>>> acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
>>> bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
>>> clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
>>> csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
>>> cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
>>> cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
>>> dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,
>>> dl1=\E[M, dsl=\E]2;\007, ed=\E[J, el=\E[K, el1=\E[1K,
>>> enacs=\E(B\E)0, flash=\E[?5h$<200/>\E[?5l, fsl=^G,
>>> home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
>>> ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
>>> kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, ka1=\EOq,
>>> ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, kcbt=\E[Z,
>>> kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
>>> kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
>>> kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
>>> kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
>>> kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
>>> kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
>>> khome=\EOH, knp=\E[6~, kpp=\E[5~, op=\E[0m, rc=\E8,
>>> rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
>>> rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
>>> rmso=\E[m, rmul=\E[m,
>>> rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
>>> setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
>>> setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
>>> 
>>> sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
>>> sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h,
>>> smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
>>> tbc=\E[3g, tsl=\E]2;, u6=\E[%i%d;%dR, u7=\E[6n,
>>> u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd, T

Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-07 Thread Nicholas Marriott
+tmux-users


On Thu, May 07, 2015 at 10:01:03AM +0100, Nicholas Marriott wrote:
> Hi
> 
> Well that explains it, since you have kLFT3=\Eb tmux will send M-Left
> instead of M-b for \Eb (and Option+Left since your terminal sends \Eb
> for that too).
> 
> 
> 
> On Thu, May 07, 2015 at 10:51:52AM +0200, Leonardo Brondani Schenkel wrote:
> > On 07/05/15 09:58, Nicholas Marriott wrote:
> > > "new key ^[b: 0x301f (M-Left)"
> > > Are you sure your tmux is unmodified?
> > 
> > It's the version available on MacPorts. As far as I can see it does not
> > patch tmux in any significant way:
> > https://trac.macports.org/browser/trunk/dports/sysutils/tmux?rev=132936
> > 
> > Actually tmux 2.0 just landed in MacPorts but I didn't install it yet.
> > I can upgrade to it and repeat the experiment if it might help.
> > 
> > > Did you use "infocmp -x" when dumping the terminfo entries you sent? If
> > > not, try "infocmp -x nsterm" and look for kLFT3.
> > 
> > No, sorry, I overlooked that and didn't use "-x". The output with "-x"
> > is listed below. kLFT3 is not there, but I checked my terminfo sources
> > (I'm using a custom ~/.terminfo compiled from the latest database:
> > version 1.536) and KLFT3 *is* present (in fact I was the one who
> > actually suggested these new capabilities/entries in the ncurses mailing
> > list in the first place):
> > 
> > nsterm-build326|Terminal.app in OS X 10.9,
> > kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, kcbt=\E[Z,
> > kf18=\E[32~, kDC5=\E[3;5~, kDC7=\E[3;5~, kLFT3=\Eb,
> > kLFT5=\E[1;5D, kRIT3=\Ef, kRIT5=\E[1;5C,
> > use=nsterm-256color,
> > # actually "343.7"
> > nsterm-build343|Terminal.app in OS X 10.10,
> > kend=\EOF, khome=\EOH, use=nsterm-build326,
> > # This is an alias which should always point to the "current" version
> > nsterm|Apple_Terminal|AppKit Terminal.app,
> > use=nsterm-build343,
> > 
> > 
> > $ infocmp -x
> > #   Reconstructed via infocmp from file:
> > /Users/Leonardo/.local/share/terminfo/6e/nsterm
> > nsterm|Apple_Terminal|AppKit Terminal.app,
> > am, bce, hs, mir, msgr, npc, xenl, xon,
> > colors#256, cols#80, it#8, lines#24, pairs#32767, wsl#50,
> > acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
> > bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
> > clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
> > csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
> > cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
> > cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
> > dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,
> > dl1=\E[M, dsl=\E]2;\007, ed=\E[J, el=\E[K, el1=\E[1K,
> > enacs=\E(B\E)0, flash=\E[?5h$<200/>\E[?5l, fsl=^G,
> > home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
> > ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
> > kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, ka1=\EOq,
> > ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, kcbt=\E[Z,
> > kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
> > kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
> > kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
> > kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
> > kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
> > kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
> > khome=\EOH, knp=\E[6~, kpp=\E[5~, op=\E[0m, rc=\E8,
> > rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
> > rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
> > rmso=\E[m, rmul=\E[m,
> > rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
> > setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
> > setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
> > 
> > sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
> > sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h,
> > smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
> > tbc=\E[3g, tsl=\E]2;, u6=\E[%i%d;%dR, u7=\E[6n,
> > u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd, TS=\E]2;,
> > kDC5=\E[3;5~, kDC7=\E[3;5~, kLFT3=\Eb, kLFT5=\E[1;5D,
> > kRIT3=\Ef, kRIT5=\E[1;5C,
> > 
> > > 
> > > 
> > > On Thu, May 07, 2015 at 09:43:15AM +0200, Leonardo Brondani Schenkel 
> > > wrote:
> > >> On 07/05/15 00:31, Thomas Adam wrote:
> > >>> TERM=nsterm tmux - -Ltest -f/dev/null new
> > >>
> > >> Log files are attached: I started tmux as directed, invoked "cat",
> > >> pressed Option/Alt+Left three times, then Enter/Return, then Ctrl+D
> > >> twice. This was done twice, one with TERM=nsterm (filename suffix
> > >> -nsterm) and one with TERM=xterm-256color (filename suffix -xterm).
> > >>
> > >> // Leonardo.
> > >>
> > > 
> > >> got 207 from server
> > >> got 203 from server
> > >> got 204 from server
> > > 
> > >> got 207 from server
> > >> got 203 from server
> > >> got 204 from server
> > > 
> > > 
> > > 
> > > 
> > > 
> > >> 

Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-07 Thread Leonardo Brondani Schenkel
On 07/05/15 09:58, Nicholas Marriott wrote:
> "new key ^[b: 0x301f (M-Left)"
> Are you sure your tmux is unmodified?

It's the version available on MacPorts. As far as I can see it does not
patch tmux in any significant way:
https://trac.macports.org/browser/trunk/dports/sysutils/tmux?rev=132936

Actually tmux 2.0 just landed in MacPorts but I didn't install it yet.
I can upgrade to it and repeat the experiment if it might help.

> Did you use "infocmp -x" when dumping the terminfo entries you sent? If
> not, try "infocmp -x nsterm" and look for kLFT3.

No, sorry, I overlooked that and didn't use "-x". The output with "-x"
is listed below. kLFT3 is not there, but I checked my terminfo sources
(I'm using a custom ~/.terminfo compiled from the latest database:
version 1.536) and KLFT3 *is* present (in fact I was the one who
actually suggested these new capabilities/entries in the ncurses mailing
list in the first place):

nsterm-build326|Terminal.app in OS X 10.9,
kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, kcbt=\E[Z,
kf18=\E[32~, kDC5=\E[3;5~, kDC7=\E[3;5~, kLFT3=\Eb,
kLFT5=\E[1;5D, kRIT3=\Ef, kRIT5=\E[1;5C,
use=nsterm-256color,
# actually "343.7"
nsterm-build343|Terminal.app in OS X 10.10,
kend=\EOF, khome=\EOH, use=nsterm-build326,
# This is an alias which should always point to the "current" version
nsterm|Apple_Terminal|AppKit Terminal.app,
use=nsterm-build343,


$ infocmp -x
#   Reconstructed via infocmp from file:
/Users/Leonardo/.local/share/terminfo/6e/nsterm
nsterm|Apple_Terminal|AppKit Terminal.app,
am, bce, hs, mir, msgr, npc, xenl, xon,
colors#256, cols#80, it#8, lines#24, pairs#32767, wsl#50,
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,
dl1=\E[M, dsl=\E]2;\007, ed=\E[J, el=\E[K, el1=\E[1K,
enacs=\E(B\E)0, flash=\E[?5h$<200/>\E[?5l, fsl=^G,
home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, ka1=\EOq,
ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, kcbt=\E[Z,
kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
khome=\EOH, knp=\E[6~, kpp=\E[5~, op=\E[0m, rc=\E8,
rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
rmso=\E[m, rmul=\E[m,
rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,

sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h,
smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
tbc=\E[3g, tsl=\E]2;, u6=\E[%i%d;%dR, u7=\E[6n,
u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd, TS=\E]2;,
kDC5=\E[3;5~, kDC7=\E[3;5~, kLFT3=\Eb, kLFT5=\E[1;5D,
kRIT3=\Ef, kRIT5=\E[1;5C,

> 
> 
> On Thu, May 07, 2015 at 09:43:15AM +0200, Leonardo Brondani Schenkel wrote:
>> On 07/05/15 00:31, Thomas Adam wrote:
>>> TERM=nsterm tmux - -Ltest -f/dev/null new
>>
>> Log files are attached: I started tmux as directed, invoked "cat",
>> pressed Option/Alt+Left three times, then Enter/Return, then Ctrl+D
>> twice. This was done twice, one with TERM=nsterm (filename suffix
>> -nsterm) and one with TERM=xterm-256color (filename suffix -xterm).
>>
>> // Leonardo.
>>
> 
>> got 207 from server
>> got 203 from server
>> got 204 from server
> 
>> got 207 from server
>> got 203 from server
>> got 204 from server
> 
> 
> 
> 
> 
>> --
>> One dashboard for servers and applications across Physical-Virtual-Cloud 
>> Widest out-of-the-box monitoring support with 50+ applications
>> Performance metrics, stats and reports that give you Actionable Insights
>> Deep dive visibility with transaction tracing using APM Insight.
>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> 
>> ___
>> tmux-users mailing list
>> tmux-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/tmux-users
> 
> 
> ---

Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-07 Thread Nicholas Marriott
Hi

"new key ^[b: 0x301f (M-Left)"

Are you sure your tmux is unmodified?

Did you use "infocmp -x" when dumping the terminfo entries you sent? If
not, try "infocmp -x nsterm" and look for kLFT3.


On Thu, May 07, 2015 at 09:43:15AM +0200, Leonardo Brondani Schenkel wrote:
> On 07/05/15 00:31, Thomas Adam wrote:
> > TERM=nsterm tmux - -Ltest -f/dev/null new
> 
> Log files are attached: I started tmux as directed, invoked "cat",
> pressed Option/Alt+Left three times, then Enter/Return, then Ctrl+D
> twice. This was done twice, one with TERM=nsterm (filename suffix
> -nsterm) and one with TERM=xterm-256color (filename suffix -xterm).
> 
> // Leonardo.
> 

> got 207 from server
> got 203 from server
> got 204 from server

> got 207 from server
> got 203 from server
> got 204 from server





> --
> One dashboard for servers and applications across Physical-Virtual-Cloud 
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y

> ___
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users


--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-07 Thread Leonardo Brondani Schenkel
On 07/05/15 00:31, Thomas Adam wrote:
> TERM=nsterm tmux - -Ltest -f/dev/null new

Log files are attached: I started tmux as directed, invoked "cat",
pressed Option/Alt+Left three times, then Enter/Return, then Ctrl+D
twice. This was done twice, one with TERM=nsterm (filename suffix
-nsterm) and one with TERM=xterm-256color (filename suffix -xterm).

// Leonardo.

got 207 from server
got 203 from server
got 204 from server
got 207 from server
got 203 from server
got 204 from server


tmux-out-nsterm.log
Description: Binary data


tmux-out-xterm.log
Description: Binary data


tmux-server-nsterm.log
Description: Binary data


tmux-server-xterm.log
Description: Binary data
--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-06 Thread Nicholas Marriott
Yes of course, sorry.


On Wed, May 06, 2015 at 11:31:51PM +0100, Thomas Adam wrote:
> On 6 May 2015 at 22:42, Nicholas Marriott  wrote:
> > Hmm weird.
> >
> > There is nothing in the nsterm terminfo to make tmux think that M-b is
> > actually M-Left.
> >
> > Please run "TERM=nsterm tmux -Ltest -f/dev/null new" then press Option+Left
> 
> That should be:
> 
> TERM=nsterm tmux - -Ltest -f/dev/null new
> 
> -- Thomas Adam

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-06 Thread Thomas Adam
On 6 May 2015 at 22:42, Nicholas Marriott  wrote:
> Hmm weird.
>
> There is nothing in the nsterm terminfo to make tmux think that M-b is
> actually M-Left.
>
> Please run "TERM=nsterm tmux -Ltest -f/dev/null new" then press Option+Left

That should be:

TERM=nsterm tmux - -Ltest -f/dev/null new

-- Thomas Adam

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-06 Thread Nicholas Marriott
Hmm weird.

There is nothing in the nsterm terminfo to make tmux think that M-b is
actually M-Left.

Please run "TERM=nsterm tmux -Ltest -f/dev/null new" then press Option+Left
a few times, then exit tmux and send me the tmux-server-*.log that will
be in the current directory.


On Wed, May 06, 2015 at 09:09:22PM +0200, Leonardo Brondani Schenkel wrote:
> On 06/05/2015 20:49, Nicholas Marriott wrote:
> > Are you sure it is \[b not \[[b?
> 
> Positive. Just double checked via cat: ^[b. In Terminal.app preferences
> it's shown as \033b.
> 
> > 
> >  Original message 
> > From: Leonardo Brondani Schenkel
> > Date:06/05/2015 16:50 (GMT+00:00)
> > To: Nicholas Marriott
> > Cc: tmux-users@lists.sourceforge.net
> > Subject: Re: Q: tmux sending different key escape codes for
> > Option+Left/Right depending on $TERM?
> > 
> > 
> >> On 06 May 2015, at 17:21, Nicholas Marriott
> >  wrote:
> >>
> >> Hi
> >>
> >> What does the terminal actually send outside tmux for Option+Left?
> > 
> > ^[b. It's an explicit binding that comes pre-configured by default in
> > Terminal.app (but can be changed). I am almost certain that it does not
> > depend on the application mode (explicit bindings don't) but I'll
> > confirm that once I use my Mac again and I'll reply in case I'm wrong.
> > 
> >> You should be able to see by running "cat" and then pressing the keys.
> > 
> > Yes. That's how I captured the tmux escapes in the first place. (I'm
> > also sending smkx or rmkx before 'cat'.)
> >>
> >>> On Wed, May 06, 2015 at 04:59:12PM +0200, Leonardo Brondani Schenkel
> > wrote:
> >>> Hello,
> >>>
> >>> I'm using tmux 1.9a in Terminal.app 343.7 (OS X 10.10). I noticed by
> >>> accident that when I press Option+Left/Right I get different escape
> >>> codes, depending if the $TERM variable outside tmux is set to 'nsterm'
> >>> or 'xterm'.
> >>>
> >>> For example, when pressing Option+Left:
> >>>
> >>> $TERM=='nsterm': ^[^[OD or ^[^[[D (depends on application mode)
> >>> $TERM=='xterm':  ^[b (does not depend on the mode)
> >>>
> >>> The option 'xterm-keys' is off in both cases.
> >>>
> >>> I'm just wondering if this behavior is documented because I could not
> >>> find any references in the man page. I'm interested (for no particular
> >>> reason besides my personal curiosity) in finding out what's the exact
> >>> logic that tmux uses to determine the escape sequence to send to the
> >>> application; I inspected the source code but I'm not familiar with the
> >>> codebase and I'm having trouble figuring this out on my own. I would
> >>> appreciate if somebody could shed some light on this.
> >>>
> >>> For reference, these are my terminfo capabilities:
> >>>
> >>> nsterm|Apple_Terminal|AppKit Terminal.app,
> >>>am, bce, hs, mir, msgr, npc, xenl, xon,
> >>>colors#256, cols#80, it#8, lines#24, pairs#32767, wsl#50,
> >>>acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
> >>>bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
> >>>clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
> >>>csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
> >>>cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
> >>>cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
> >>>dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,
> >>>dl1=\E[M, dsl=\E]2;\007, ed=\E[J, el=\E[K, el1=\E[1K,
> >>>enacs=\E(B\E)0, flash=\E[?5h$<200/>\E[?5l, fsl=^G,
> >>>home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
> >>>ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
> >>>kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, ka1=\EOq,
> >>>ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, kcbt=\E[Z,
> >>>kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
> >>>kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
> >>>kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
> >>>kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
> >>>kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
> >>>kf5=\E[15~, kf6=\E[

Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-06 Thread Leonardo Brondani Schenkel
On 06/05/2015 20:49, Nicholas Marriott wrote:
> Are you sure it is \[b not \[[b?

Positive. Just double checked via cat: ^[b. In Terminal.app preferences
it's shown as \033b.

> 
>  Original message 
> From: Leonardo Brondani Schenkel
> Date:06/05/2015 16:50 (GMT+00:00)
> To: Nicholas Marriott
> Cc: tmux-users@lists.sourceforge.net
> Subject: Re: Q: tmux sending different key escape codes for
> Option+Left/Right depending on $TERM?
> 
> 
>> On 06 May 2015, at 17:21, Nicholas Marriott
>  wrote:
>>
>> Hi
>>
>> What does the terminal actually send outside tmux for Option+Left?
> 
> ^[b. It's an explicit binding that comes pre-configured by default in
> Terminal.app (but can be changed). I am almost certain that it does not
> depend on the application mode (explicit bindings don't) but I'll
> confirm that once I use my Mac again and I'll reply in case I'm wrong.
> 
>> You should be able to see by running "cat" and then pressing the keys.
> 
> Yes. That's how I captured the tmux escapes in the first place. (I'm
> also sending smkx or rmkx before 'cat'.)
>>
>>> On Wed, May 06, 2015 at 04:59:12PM +0200, Leonardo Brondani Schenkel
> wrote:
>>> Hello,
>>>
>>> I'm using tmux 1.9a in Terminal.app 343.7 (OS X 10.10). I noticed by
>>> accident that when I press Option+Left/Right I get different escape
>>> codes, depending if the $TERM variable outside tmux is set to 'nsterm'
>>> or 'xterm'.
>>>
>>> For example, when pressing Option+Left:
>>>
>>> $TERM=='nsterm': ^[^[OD or ^[^[[D (depends on application mode)
>>> $TERM=='xterm':  ^[b (does not depend on the mode)
>>>
>>> The option 'xterm-keys' is off in both cases.
>>>
>>> I'm just wondering if this behavior is documented because I could not
>>> find any references in the man page. I'm interested (for no particular
>>> reason besides my personal curiosity) in finding out what's the exact
>>> logic that tmux uses to determine the escape sequence to send to the
>>> application; I inspected the source code but I'm not familiar with the
>>> codebase and I'm having trouble figuring this out on my own. I would
>>> appreciate if somebody could shed some light on this.
>>>
>>> For reference, these are my terminfo capabilities:
>>>
>>> nsterm|Apple_Terminal|AppKit Terminal.app,
>>>am, bce, hs, mir, msgr, npc, xenl, xon,
>>>colors#256, cols#80, it#8, lines#24, pairs#32767, wsl#50,
>>>acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
>>>bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
>>>clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
>>>csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
>>>cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
>>>cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
>>>dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,
>>>dl1=\E[M, dsl=\E]2;\007, ed=\E[J, el=\E[K, el1=\E[1K,
>>>enacs=\E(B\E)0, flash=\E[?5h$<200/>\E[?5l, fsl=^G,
>>>home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
>>>ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
>>>kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, ka1=\EOq,
>>>ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, kcbt=\E[Z,
>>>kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
>>>kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
>>>kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
>>>kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
>>>kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
>>>kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
>>>khome=\EOH, knp=\E[6~, kpp=\E[5~, op=\E[0m, rc=\E8,
>>>rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
>>>rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
>>>rmso=\E[m, rmul=\E[m,
>>>rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
>>>
>>> setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
>>>
>>> setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
>>>
>>>
> sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
>>>sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[

Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-06 Thread Nicholas Marriott
Are you sure it is \[b not \[[b?

 Original message 
From: Leonardo Brondani Schenkel  
Date:06/05/2015  16:50  (GMT+00:00) 
To: Nicholas Marriott  
Cc: tmux-users@lists.sourceforge.net 
Subject: Re: Q: tmux sending different key escape codes for Option+Left/Right 
depending on $TERM? 


> On 06 May 2015, at 17:21, Nicholas Marriott  
> wrote:
> 
> Hi
> 
> What does the terminal actually send outside tmux for Option+Left?

^[b. It's an explicit binding that comes pre-configured by default in 
Terminal.app (but can be changed). I am almost certain that it does not depend 
on the application mode (explicit bindings don't) but I'll confirm that once I 
use my Mac again and I'll reply in case I'm wrong. 

> You should be able to see by running "cat" and then pressing the keys.

Yes. That's how I captured the tmux escapes in the first place. (I'm also 
sending smkx or rmkx before 'cat'.)
> 
>> On Wed, May 06, 2015 at 04:59:12PM +0200, Leonardo Brondani Schenkel wrote:
>> Hello,
>> 
>> I'm using tmux 1.9a in Terminal.app 343.7 (OS X 10.10). I noticed by
>> accident that when I press Option+Left/Right I get different escape
>> codes, depending if the $TERM variable outside tmux is set to 'nsterm'
>> or 'xterm'.
>> 
>> For example, when pressing Option+Left:
>> 
>> $TERM=='nsterm': ^[^[OD or ^[^[[D (depends on application mode)
>> $TERM=='xterm':  ^[b (does not depend on the mode)
>> 
>> The option 'xterm-keys' is off in both cases.
>> 
>> I'm just wondering if this behavior is documented because I could not
>> find any references in the man page. I'm interested (for no particular
>> reason besides my personal curiosity) in finding out what's the exact
>> logic that tmux uses to determine the escape sequence to send to the
>> application; I inspected the source code but I'm not familiar with the
>> codebase and I'm having trouble figuring this out on my own. I would
>> appreciate if somebody could shed some light on this.
>> 
>> For reference, these are my terminfo capabilities:
>> 
>> nsterm|Apple_Terminal|AppKit Terminal.app,
>>    am, bce, hs, mir, msgr, npc, xenl, xon,
>>    colors#256, cols#80, it#8, lines#24, pairs#32767, wsl#50,
>>    acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
>>    bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
>>    clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
>>    csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
>>    cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
>>    cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
>>    dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,
>>    dl1=\E[M, dsl=\E]2;\007, ed=\E[J, el=\E[K, el1=\E[1K,
>>    enacs=\E(B\E)0, flash=\E[?5h$<200/>\E[?5l, fsl=^G,
>>    home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
>>    ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
>>    kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, ka1=\EOq,
>>    ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, kcbt=\E[Z,
>>    kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
>>    kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
>>    kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
>>    kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
>>    kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
>>    kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
>>    khome=\EOH, knp=\E[6~, kpp=\E[5~, op=\E[0m, rc=\E8,
>>    rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
>>    rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
>>    rmso=\E[m, rmul=\E[m,
>>    rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
>> 
>> setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
>> 
>> setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
>> 
>> sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
>>    sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h,
>>    smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
>>    tbc=\E[3g, tsl=\E]2;, u6=\E[%i%d;%dR, u7=\E[6n,
>>    u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd,
>> 
>> xterm-256color|xterm with 256 colors,
>>    am, bce, ccc, km, mc5i, mir, msgr, npc, xenl,
>>    colors#256, cols#80, it#8, lines#24, pairs#32767,
>>    acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
>>    bel=^G, blink=\E[5m, bo

Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-06 Thread Leonardo Brondani Schenkel
> On 06 May 2015, at 17:21, Nicholas Marriott  
> wrote:
> What does the terminal actually send outside tmux for Option+Left?

^[b. It's an explicit binding that comes pre-configured by default in
Terminal.app (but can be changed). It does not change if the terminal is
in application mode or not (explicit bindings always generate the same
sequence).

> You should be able to see by running "cat" and then pressing the keys.

Yes. That's how I captured the tmux escapes in the first place. (I'm
also sending smkx or rmkx before 'cat'.)

> 
>> On Wed, May 06, 2015 at 04:59:12PM +0200, Leonardo Brondani Schenkel wrote:
>> Hello,
>> 
>> I'm using tmux 1.9a in Terminal.app 343.7 (OS X 10.10). I noticed by
>> accident that when I press Option+Left/Right I get different escape
>> codes, depending if the $TERM variable outside tmux is set to 'nsterm'
>> or 'xterm'.
>> 
>> For example, when pressing Option+Left:
>> 
>> $TERM=='nsterm': ^[^[OD or ^[^[[D (depends on application mode)
>> $TERM=='xterm':  ^[b (does not depend on the mode)
>> 
>> The option 'xterm-keys' is off in both cases.
>> 
>> I'm just wondering if this behavior is documented because I could not
>> find any references in the man page. I'm interested (for no particular
>> reason besides my personal curiosity) in finding out what's the exact
>> logic that tmux uses to determine the escape sequence to send to the
>> application; I inspected the source code but I'm not familiar with the
>> codebase and I'm having trouble figuring this out on my own. I would
>> appreciate if somebody could shed some light on this.
>> 
>> For reference, these are my terminfo capabilities:
>> 
>> nsterm|Apple_Terminal|AppKit Terminal.app,
>>am, bce, hs, mir, msgr, npc, xenl, xon,
>>colors#256, cols#80, it#8, lines#24, pairs#32767, wsl#50,
>>acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
>>bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
>>clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
>>csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
>>cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
>>cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
>>dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,
>>dl1=\E[M, dsl=\E]2;\007, ed=\E[J, el=\E[K, el1=\E[1K,
>>enacs=\E(B\E)0, flash=\E[?5h$<200/>\E[?5l, fsl=^G,
>>home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
>>ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
>>kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, ka1=\EOq,
>>ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, kcbt=\E[Z,
>>kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
>>kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
>>kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
>>kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
>>kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
>>kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
>>khome=\EOH, knp=\E[6~, kpp=\E[5~, op=\E[0m, rc=\E8,
>>rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
>>rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
>>rmso=\E[m, rmul=\E[m,
>>rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
>> 
>> setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
>> 
>> setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
>> 
>> sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
>>sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h,
>>smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
>>tbc=\E[3g, tsl=\E]2;, u6=\E[%i%d;%dR, u7=\E[6n,
>>u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd,
>> 
>> xterm-256color|xterm with 256 colors,
>>am, bce, ccc, km, mc5i, mir, msgr, npc, xenl,
>>colors#256, cols#80, it#8, lines#24, pairs#32767,
>>acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
>>bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
>>clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M,
>>csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
>>cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
>>cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
>>cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
>>dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
>>el1=\E[1K, flash=\E[?5h$<100/>\E[?5l, home=\E[H,
>>hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
>>il=\E[%p1%dL, il1=\E[L, ind=^J, indn=\E[%p1%dS,
>> 
>> initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
>>invis=\E[8m, is2=\E[!p\E[?3;4l\E[4l\E>, kDC=\E[3;2~,
>>kEND=\E[1;2F, kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D,
>>kNXT=\E[6;2~, kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOE, kbs=^H,
>>kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
>>kdch1

Re: Q: tmux sending different key escape codes for Option+Left/Right depending on $TERM?

2015-05-06 Thread Nicholas Marriott
Hi

What does the terminal actually send outside tmux for Option+Left?

You should be able to see by running "cat" and then pressing the keys.



On Wed, May 06, 2015 at 04:59:12PM +0200, Leonardo Brondani Schenkel wrote:
> Hello,
> 
> I'm using tmux 1.9a in Terminal.app 343.7 (OS X 10.10). I noticed by
> accident that when I press Option+Left/Right I get different escape
> codes, depending if the $TERM variable outside tmux is set to 'nsterm'
> or 'xterm'.
> 
> For example, when pressing Option+Left:
> 
> $TERM=='nsterm': ^[^[OD or ^[^[[D (depends on application mode)
> $TERM=='xterm':  ^[b (does not depend on the mode)
> 
> The option 'xterm-keys' is off in both cases.
> 
> I'm just wondering if this behavior is documented because I could not
> find any references in the man page. I'm interested (for no particular
> reason besides my personal curiosity) in finding out what's the exact
> logic that tmux uses to determine the escape sequence to send to the
> application; I inspected the source code but I'm not familiar with the
> codebase and I'm having trouble figuring this out on my own. I would
> appreciate if somebody could shed some light on this.
> 
> For reference, these are my terminfo capabilities:
> 
> nsterm|Apple_Terminal|AppKit Terminal.app,
> am, bce, hs, mir, msgr, npc, xenl, xon,
> colors#256, cols#80, it#8, lines#24, pairs#32767, wsl#50,
> acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
> bel=^G, blink=\E[5m, bold=\E[1m, civis=\E[?25l,
> clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
> csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
> cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
> cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
> dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m, dl=\E[%p1%dM,
> dl1=\E[M, dsl=\E]2;\007, ed=\E[J, el=\E[K, el1=\E[1K,
> enacs=\E(B\E)0, flash=\E[?5h$<200/>\E[?5l, fsl=^G,
> home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
> ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
> kDC=\E[3;2~, kLFT=\E[1;2D, kRIT=\E[1;2C, ka1=\EOq,
> ka3=\EOs, kb2=\EOr, kbs=\177, kc1=\EOp, kc3=\EOn, kcbt=\E[Z,
> kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
> kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
> kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
> kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
> kf19=\E[33~, kf2=\EOQ, kf20=\E[34~, kf3=\EOR, kf4=\EOS,
> kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
> khome=\EOH, knp=\E[6~, kpp=\E[5~, op=\E[0m, rc=\E8,
> rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
> rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
> rmso=\E[m, rmul=\E[m,
> rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
> 
> setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
> 
> setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
> 
> sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
> sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h,
> smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
> tbc=\E[3g, tsl=\E]2;, u6=\E[%i%d;%dR, u7=\E[6n,
> u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd,
> 
> xterm-256color|xterm with 256 colors,
> am, bce, ccc, km, mc5i, mir, msgr, npc, xenl,
> colors#256, cols#80, it#8, lines#24, pairs#32767,
> acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
> bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
> clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M,
> csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
> cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
> cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
> cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
> dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
> el1=\E[1K, flash=\E[?5h$<100/>\E[?5l, home=\E[H,
> hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d@,
> il=\E[%p1%dL, il1=\E[L, ind=^J, indn=\E[%p1%dS,
> 
> initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
> invis=\E[8m, is2=\E[!p\E[?3;4l\E[4l\E>, kDC=\E[3;2~,
> kEND=\E[1;2F, kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D,
> kNXT=\E[6;2~, kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOE, kbs=^H,
> kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
> kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
> kf11=\E[23~, kf12=\E[24~, kf13=\E[1;2P, kf14=\E[1;2Q,
> kf15=\E[1;2R, kf16=\E[1;2S, kf17=\E[15;2~, kf18=\E[17;2~,
> kf19=\E[18;2~, kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~,
> kf22=\E[21;2~, kf23=\E[23;2~, kf24=\E[24;2~,
> kf25=\E[1;5P, kf26=\E[1;5Q, kf27=\E[1;5R, kf28=\E[1;5S,
> kf29=\E[15;5~, kf3=\EOR, kf30=\E[17;5~, kf31=\E[18;5