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"
>      > * *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.
>      
> [4]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.
>      > [5]http://p.sf.net/sfu/appdyn_d2d_ap2
> 
>      > _______________________________________________
>      > tmux-users mailing list
>      > [6]tmux-users@lists.sourceforge.net
>      > [7]https://lists.sourceforge.net/lists/listinfo/tmux-users
> 
> References
> 
>    Visible links
>    1. https://gist.github.com/saamalik/5691197
>    2. mailto:nicholas.marri...@gmail.com
>    3. 
> http://sourceforge.net/mailarchive/forum.php?thread_name=BAY156-w42377C17048D1DADD1882CAECC0%40phx.gbl&forum_name=tmux-users
>    4. 
> http://sourceforge.net/mailarchive/forum.php?thread_name=BAY156-w42377C17048D1DADD1882CAECC0%40phx.gbl&forum_name=tmux-users
>    5. http://p.sf.net/sfu/appdyn_d2d_ap2
>    6. mailto:tmux-users@lists.sourceforge.net
>    7. 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

Reply via email to