Re: Cursor Color/Style not resetting when switching panes/windows

2013-06-01 Thread Nicholas Marriott
It was merged. If you use the DCS \ePtmux;...\e\\ escaping then it won't
work, that makes tmux pass the cursor sequences through without
tracking them.



On Fri, May 31, 2013 at 05:45:39PM -0700, simfox3 wrote:
>Hi All,
>In VIM, my normal mode cursor is a block, like most of you I presume. If I
>switch panes or windows while in normal mode, the cursor style (block)
>comes along for the ride. Sure, I could issue a simple escape sequence
>(echo -ne "\e[5 q") to reset it to the vertical line, but wouldn't it be
>awesome if tmux handles this?
>It turns out that in 2011 some gentleman made a patch to keep track of the
>cursor color/styles per pane/window but I don't think it was merged.
>Anyway, here is the thread for more info:
>
> [1]http://sourceforge.net/mailarchive/forum.php?thread_name=BAY156-w42377C17048D1DADD1882CAECC0%40phx.gbl&forum_name=tmux-users
>For the time being, is there a workaround? Should this get addressed?*
>My setup:
>* Terminal: Mintty (CYGWIN)
>* SSH -> Ubuntu 13.04
>* Tmux 1.8
>Thanks,
>Saad
>For other Cygwin TTY users SSHing into a TMUX Box, these are the VIM
>escape sequences to use:*
>" tmux escape the mintty mode-dependent cursor escapes; the weird 1049H
>and 1049L sequences save/restore the alternate screen on VIM start/exit--I
>think.
>let &t_ti="\ePtmux;\e\e[1 q\e\\\e[?1049h"
>let &t_te="\ePtmux;\e\e[0 q\e\\\e[?1049l"
>let &t_SI="\ePtmux;\e\e[5 q\e\\"
>let &t_EI="\ePtmux;\e\e[1 q\e\\"
> 
> References
> 
>Visible links
>1. 
> http://sourceforge.net/mailarchive/forum.php?thread_name=BAY156-w42377C17048D1DADD1882CAECC0%40phx.gbl&forum_name=tmux-users

> --
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2

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


--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


command too long

2013-06-01 Thread Jack Bates
I keep getting an error, "command too long" when I run:

$ tmux new-session ...

I wish that the tmux COMMAND_LENGTH was more than 2048.

If tmux could handle commands of arbitrary length, up to something like 
the maximum argument length for the system (ARG_MAX), that would be 
cool. But even just increasing COMMAND_LENGTH a bit would be a 
significant improvement for me...

Thank you for tmux!

--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: command too long

2013-06-01 Thread Nicholas Marriott
Hi

What commands are you doing that regularly exceed 2048 bytes and why
can't you put them in a temporary script or something and run that
instead?


On Thu, May 30, 2013 at 08:49:05AM -0700, Jack Bates wrote:
> I keep getting an error, "command too long" when I run:
> 
> $ tmux new-session ...
> 
> I wish that the tmux COMMAND_LENGTH was more than 2048.
> 
> If tmux could handle commands of arbitrary length, up to something like 
> the maximum argument length for the system (ARG_MAX), that would be 
> cool. But even just increasing COMMAND_LENGTH a bit would be a 
> significant improvement for me...
> 
> Thank you for tmux!
> 
> --
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2
> ___
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users


Re: Cursor Color/Style not resetting when switching panes/windows

2013-06-01 Thread simfox3
Hi Nicholas,

I've been playing around with various escape code using echo -ne and here
are my observations:

1. The CORRECT mintty escape code to reset cursor style back to the default
vertical line is: '\e[0 q'. Tmux is swallowing this specific escape
sequence, and not passing it on to the terminal. If I DCS \ePtmux;...\e\\
escape this sequence, then the terminal temporarily resets the cursor to
the vertical line, but since tmux doesn't track DCS escaped codes,
switching back to this pane/window changes the cursor back to the previous
style, e.g: block cursor \e[1 q. The underscore mintty cursor escape (\e[3
q) is being relayed and stored. Only the '\e[0 q' sequence isn't relayed to
the underlying terminal. Any reason for this?
2. How can I set the default cursor escape code for panes/windows? The
initial cursor style is the the same as the (non-tmux) terminal that starts
tmux. For example, in my non-tmux terminal if I change cursor to blinking
underscore (\e[3 q), and then launch tmux--all new created panes will have
the underscore cursor. However, as soon as I change any pane's cursor (e.g:
echo -ne "\e[1 q"), then the cursor is changed to a non-blinking block
(\e[2 q) for ALL other panes. Where is this \e[2 q coming from? Where can I
change it? I tried setting my terminal-overrides, but the tmux server dies
after a cursor echo escape code no matter what I put in there--even with
the verbatim copy of the default terminal-override.
3. Upon exiting tmux, the launching terminal cursor also changes to
non-blinking block (\e[2 q). I'm assuming that fixing the previous issue
will fix this one too.

MY CONFIG:

Typical tmux.conf (90% from tmux by Brian Hogan):
https://gist.github.com/saamalik/5691197
The

I am NOT setting any terminal-overrides in tmux.conf. However, this is the
output of the default terminal-overrides:

$ tmux show-options -g terminal-overrides
terminal-overrides
"*88col*:colors=88,*256col*:colors=256,xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E[%p1%d
q:Csr=\E[2 q,screen*:XT"




On Sat, Jun 1, 2013 at 12:24 AM, Nicholas Marriott <
nicholas.marri...@gmail.com> wrote:

> It was merged. If you use the DCS \ePtmux;...\e\\ escaping then it won't
> work, that makes tmux pass the cursor sequences through without
> tracking them.
>
>
>
> On Fri, May 31, 2013 at 05:45:39PM -0700, simfox3 wrote:
> >Hi All,
> >In VIM, my normal mode cursor is a block, like most of you I presume.
> If I
> >switch panes or windows while in normal mode, the cursor style (block)
> >comes along for the ride. Sure, I could issue a simple escape sequence
> >(echo -ne "\e[5 q") to reset it to the vertical line, but wouldn't it
> be
> >awesome if tmux handles this?
> >It turns out that in 2011 some gentleman made a patch to keep track
> of the
> >cursor color/styles per pane/window but I don't think it was merged.
> >Anyway, here is the thread for more info:
> >[1]
> http://sourceforge.net/mailarchive/forum.php?thread_name=BAY156-w42377C17048D1DADD1882CAECC0%40phx.gbl&forum_name=tmux-users
> >For the time being, is there a workaround? Should this get addressed?*
> >My setup:
> >* Terminal: Mintty (CYGWIN)
> >* SSH -> Ubuntu 13.04
> >* Tmux 1.8
> >Thanks,
> >Saad
> >For other Cygwin TTY users SSHing into a TMUX Box, these are the VIM
> >escape sequences to use:*
> >" tmux escape the mintty mode-dependent cursor escapes; the weird
> 1049H
> >and 1049L sequences save/restore the alternate screen on VIM
> start/exit--I
> >think.
> >let &t_ti="\ePtmux;\e\e[1 q\e\\\e[?1049h"
> >let &t_te="\ePtmux;\e\e[0 q\e\\\e[?1049l"
> >let &t_SI="\ePtmux;\e\e[5 q\e\\"
> >let &t_EI="\ePtmux;\e\e[1 q\e\\"
> >
> > References
> >
> >Visible links
> >1.
> http://sourceforge.net/mailarchive/forum.php?thread_name=BAY156-w42377C17048D1DADD1882CAECC0%40phx.gbl&forum_name=tmux-users
>
> >
> --
> > Get 100% visibility into Java/.NET code with AppDynamics Lite
> > It's a free troubleshooting tool designed for production
> > Get down to code-level detail for bottlenecks, with <2% overhead.
> > Download for free and get started troubleshooting in minutes.
> > http://p.sf.net/sfu/appdyn_d2d_ap2
>
> > ___
> > tmux-users mailing list
> > tmux-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/tmux-users
>
>
--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2___
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sour

Re: Cursor Color/Style not resetting when switching panes/windows

2013-06-01 Thread Nicholas Marriott
Unfortunately, in xterm "0 q" is not the sequence to reset cursor style
to what you configured. It always resets it to "blinking block". Which
IMO is silly but I guess it probably matches the DEC behaviour and it's
the way it is.

Anyway, in tmux we do need some way to reset to the actual default, so
we added the Csr terminfo entry. It defaults to "steady block" because
IIRC that is the actual default in xterm and anyway it's what I use.

So if you send "0 q", tmux will send the value of Csr - which in the
default terminal-overrides is "2 q" when TERM matches xterm*.

You can change Csr to whatever you want the default cursor style to
be. Or remove it to use "0 q" if that's what works for you. If tmux dies
then tell me exactly what steps you have done.

tmux will only send ANY cursor sequences when a pane has requested one,
so that's why it doesn't change until you try to change the style.





On Sat, Jun 01, 2013 at 01:42:20PM -0700, simfox3 wrote:
>Hi Nicholas,
>I've been playing around with various escape code using echo -ne and here
>are my observations:
>1. The CORRECT mintty escape code to reset cursor style back to the
>default vertical line is: '\e[0 q'. Tmux is swallowing this specific
>escape sequence, and not passing it on to the terminal. If I DCS
>\ePtmux;...\e\\* escape this sequence, then the terminal temporarily
>resets the cursor to the vertical line, but since tmux doesn't track DCS
>escaped codes, switching back to this pane/window changes the cursor back
>to the previous style, e.g: block cursor \e[1 q. The underscore mintty
>cursor escape (\e[3 q) is being relayed and stored. Only the '\e[0 q'
>sequence isn't relayed to the underlying terminal. Any reason for this?
>2. How can I set the default cursor escape code for panes/windows? The
>initial cursor style is the the same as the (non-tmux) terminal that
>starts tmux. For example, in my non-tmux terminal if I change cursor to
>blinking underscore (\e[3 q), and then launch tmux--all new created panes
>will have the underscore cursor. However, as soon as I change any pane's
>cursor (e.g: echo -ne "\e[1 q"), then the cursor is changed to a
>non-blinking block (\e[2 q) for ALL other panes. Where is this \e[2 q
>coming from? Where can I change it? I tried setting my terminal-overrides,
>but the tmux server dies after a cursor echo escape code no matter what I
>put in there--even with the verbatim copy of the default
>terminal-override.
>3. Upon exiting tmux, the launching terminal cursor also changes to
>non-blinking block (\e[2 q). I'm assuming that fixing the previous issue
>will fix this one too.*
>MY CONFIG:
>Typical tmux.conf (90% from tmux by Brian
>Hogan):*[1]https://gist.github.com/saamalik/5691197
>The*
>I am NOT setting any terminal-overrides in tmux.conf. However, this is the
>output of the default terminal-overrides:
>$ tmux show-options -g terminal-overrides
>terminal-overrides
>
> "*88col*:colors=88,*256col*:colors=256,xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E[%p1%d
>q:Csr=\E[2 q,screen*:XT"
> 
>On Sat, Jun 1, 2013 at 12:24 AM, Nicholas Marriott
><[2]nicholas.marri...@gmail.com> wrote:
> 
>  It was merged. If you use the DCS \ePtmux;...\e\\ escaping then it won't
>  work, that makes tmux pass the cursor sequences through without
>  tracking them.
> 
>  On Fri, May 31, 2013 at 05:45:39PM -0700, simfox3 wrote:
>  > * *Hi All,
>  > * *In VIM, my normal mode cursor is a block, like most of you I
>  presume. If I
>  > * *switch panes or windows while in normal mode, the cursor style
>  (block)
>  > * *comes along for the ride. Sure, I could issue a simple escape
>  sequence
>  > * *(echo -ne "\e[5 q") to reset it to the vertical line, but wouldn't
>  it be
>  > * *awesome if tmux handles this?
>  > * *It turns out that in 2011 some gentleman made a patch to keep track
>  of the
>  > * *cursor color/styles per pane/window but I don't think it was
>  merged.
>  > * *Anyway, here is the thread for more info:
>  > *
>  
> *[1][3]http://sourceforge.net/mailarchive/forum.php?thread_name=BAY156-w42377C17048D1DADD1882CAECC0%40phx.gbl&forum_name=tmux-users
>  > * *For the time being, is there a workaround? Should this get
>  addressed?*
>  > * *My setup:
>  > * ** Terminal: Mintty (CYGWIN)
>  > * ** SSH -> Ubuntu 13.04
>  > * ** Tmux 1.8
>  > * *Thanks,
>  > * *Saad
>  > * *For other Cygwin TTY users SSHing into a TMUX Box, these are the
>  VIM
>  > * *escape sequences to use:*
>  > * *" tmux escape the mintty mode-dependent cursor escapes; the weird
>  1049H
>  > * *and 1049L sequences save/restore the alternate screen on VIM
>  start/exit--I
>  > * *think.
>  > * *let &t_ti="\ePtmux;\e\e[1 q\e\\\e[?1049h"
> 

Re: Cursor Color/Style not resetting when switching panes/windows

2013-06-01 Thread simfox3
Thanks for the detailed explanation.

The tmux server crashes with a [lost server] message as soon as I send a
mouse cursor escape sequence IF terminal-overrides option is defined in
.tmux.conf--no matter what I add, remove, or set.

For example, in .tmux.conf, I'll add this basic line: set -g
terminal-overrides "88col*:colors=88,*256col*:colors=256,xterm*:XT"

$ tmux -vvv new-session
$ echo -ne "\e[3 q"
[lost server]

At this point, my terminal is hosed, and I have to close it and start a new
one.

tmux-server and tmux-client logs: https://gist.github.com/saamalik/5692227

The tail lines from tmux-server.log is when tmux is dispatching the csi
cursor command.
input_parse: 'ESC' ground
input_parse: '[' esc_enter
input_parse: '3' csi_enter
input_parse: ' ' csi_parameter
input_parse: 'q' csi_intermediate
input_csi_dispatch: 'q' " " "3"

Also, I was poking around looking for more logs, and I found an entry in
/var/log/kern.log every time tmux crashed because of the mouse cursor
sequence:
Jun  1 17:40:00 saamalik-ubuntu kernel: [375832.255154] tmux[3101]:
segfault at 3 ip 7fd596071c51 sp 7fff23a734c8 error 4 in
libc-2.17.so[7fd595fe8000+1be000]
Jun  1 17:45:21 saamalik-ubuntu kernel: [376153.197029] tmux[3189]:
segfault at 3 ip 7fc0c8ce7c51 sp 7fffda403018 error 4 in
libc-2.17.so[7fc0c8c5e000+1be000]
Jun  1 17:46:14 saamalik-ubuntu kernel: [376206.107155] tmux[3241]:
segfault at 3 ip 7f0241240c51 sp 7fffa6edfbf8 error 4 in
libc-2.17.so[7f02411b7000+1be000]

What other information would you like? I'm using tmux 1.8 from installed
binary but I'm able to reproduce this on the latest master branch (git pull
/ configure / make / ./tmux )

-Saad



On Sat, Jun 1, 2013 at 2:33 PM, Nicholas Marriott <
nicholas.marri...@gmail.com> wrote:

> Unfortunately, in xterm "0 q" is not the sequence to reset cursor style
> to what you configured. It always resets it to "blinking block". Which
> IMO is silly but I guess it probably matches the DEC behaviour and it's
> the way it is.
>
> Anyway, in tmux we do need some way to reset to the actual default, so
> we added the Csr terminfo entry. It defaults to "steady block" because
> IIRC that is the actual default in xterm and anyway it's what I use.
>
> So if you send "0 q", tmux will send the value of Csr - which in the
> default terminal-overrides is "2 q" when TERM matches xterm*.
>
> You can change Csr to whatever you want the default cursor style to
> be. Or remove it to use "0 q" if that's what works for you. If tmux dies
> then tell me exactly what steps you have done.
>
> tmux will only send ANY cursor sequences when a pane has requested one,
> so that's why it doesn't change until you try to change the style.
>
>
>
>
>
> On Sat, Jun 01, 2013 at 01:42:20PM -0700, simfox3 wrote:
> >Hi Nicholas,
> >I've been playing around with various escape code using echo -ne and
> here
> >are my observations:
> >1. The CORRECT mintty escape code to reset cursor style back to the
> >default vertical line is: '\e[0 q'. Tmux is swallowing this specific
> >escape sequence, and not passing it on to the terminal. If I DCS
> >\ePtmux;...\e\\* escape this sequence, then the terminal temporarily
> >resets the cursor to the vertical line, but since tmux doesn't track
> DCS
> >escaped codes, switching back to this pane/window changes the cursor
> back
> >to the previous style, e.g: block cursor \e[1 q. The underscore mintty
> >cursor escape (\e[3 q) is being relayed and stored. Only the '\e[0 q'
> >sequence isn't relayed to the underlying terminal. Any reason for
> this?
> >2. How can I set the default cursor escape code for panes/windows? The
> >initial cursor style is the the same as the (non-tmux) terminal that
> >starts tmux. For example, in my non-tmux terminal if I change cursor
> to
> >blinking underscore (\e[3 q), and then launch tmux--all new created
> panes
> >will have the underscore cursor. However, as soon as I change any
> pane's
> >cursor (e.g: echo -ne "\e[1 q"), then the cursor is changed to a
> >non-blinking block (\e[2 q) for ALL other panes. Where is this \e[2 q
> >coming from? Where can I change it? I tried setting my
> terminal-overrides,
> >but the tmux server dies after a cursor echo escape code no matter
> what I
> >put in there--even with the verbatim copy of the default
> >terminal-override.
> >3. Upon exiting tmux, the launching terminal cursor also changes to
> >non-blinking block (\e[2 q). I'm assuming that fixing the previous
> issue
> >will fix this one too.*
> >MY CONFIG:
> >Typical tmux.conf (90% from tmux by Brian
> >Hogan):*[1]https://gist.github.com/saamalik/5691197
> >The*
> >I am NOT setting any terminal-overrides in tmux.conf. However, this
> is the
> >output of the default terminal-overrides:
> >$ tmux show-options -g terminal-overrides
> >terminal-overrides
> >
>  
> "*88col*:colors=88,*256col*:colors