2

What must I do to make the escape sequence for double-underlining \E[4:2m work with tmux?

It works in my terminal (mintty) outside of tmux and I successfully adjusted my terminal's terminfo to account for the terminfo extensions which tmux is compatible with to enable true-colors and overlining within tmux.

However, I cannot make the extended underlining feature work (the 'Smulx' codes). Here's my terminfo:

# Compile and add to database using 'tic -x <filename>'                      
#                                                                            
stanterm-256color|xterm with non-standard terminfo extensions,               
  use=xterm-256color,                                                        
  Tc,                                                                        
  Smol=\E[53m, Rmol=\E[55m,                                                  
# These underline extensions don't work in Tmux :(                           
# Smulx=\E[< WHAT GOES HERE? >m,  
# Smul2=\E[4:2m, does not work within tmux                                           

My .tmux.conf only contains the minimal

set -g default-terminal "tmux-256color"

I am running tmux 3.0 via byobu (tmux was built from source, as the overline-feature is very new). Any ideas?

Thanks


Answer

Option 1: Adjust tmux configuration

Add set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' to your .tmux.conf yielding

# .tmux.config
set -g default-terminal "tmux-256color"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'

# ... rest of your configuration

Option 2: Adjust terminfo

Append the corresponding termcap-string Smulx=\E[4:%p1%dm, to your terminfo source file and compile it using tic -x <termfile>. Note that contrary to the previous option the Smulx entry requires a single colon.

I chose the latter option. My terminfo source file looks like this:

# Compile and add to database using 'tic -x <filename>'
#
stanterm-256color|xterm with non-standard terminfo extensions,
  use=xterm-256color,
  Tc, 
  Smol=\E[53m, Rmol=\E[55m, 
  Smulx=\E[4:%p1%dm,

1 Answer 1

2

set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'

3
  • Can you edit and explain your answer? Cheers!
    – bertieb
    May 27, 2019 at 23:08
  • Thanks - that did it! Could you explain why the terminfo entry requires a single colon while the terminal-override expects a double colon?
    – korolev
    May 28, 2019 at 8:20
  • 1
    : is a separator in terminal-overrides, :: escapes it. May 28, 2019 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.