mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Correct usage of termcap.
This commit is contained in:
		
							
								
								
									
										32
									
								
								FAQ
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								FAQ
									
									
									
									
									
								
							@@ -42,16 +42,17 @@ include as much of the following information as possible:
 | 
			
		||||
 | 
			
		||||
Please send feature requests by email to nicm@users.sourceforge.net.
 | 
			
		||||
 | 
			
		||||
* Why do you use the screen termcap inside tmux? It sucks.
 | 
			
		||||
* Why do you use the screen terminal description inside tmux? It sucks.
 | 
			
		||||
 | 
			
		||||
It is already widely available. It is planned to change to something else
 | 
			
		||||
such as xterm-color at some point, if possible.
 | 
			
		||||
It is already widely available. It is planned to change to something else such
 | 
			
		||||
as xterm-xfree86 at some point, if possible.
 | 
			
		||||
 | 
			
		||||
* I don't see any colour in my terminal! Help!
 | 
			
		||||
 | 
			
		||||
On some platforms, common termcaps such as xterm do not include colour. screen
 | 
			
		||||
ignores this, tmux does not. If the terminal emulator in use supports colour,
 | 
			
		||||
use a termcap which correctly lists this, such as xterm-color.
 | 
			
		||||
On some platforms, common terminal descriptions such as xterm do not include
 | 
			
		||||
colour. screen ignores this, tmux does not. If the terminal emulator in use
 | 
			
		||||
supports colour, use a value for TERM which correctly lists this, such as
 | 
			
		||||
xterm-color.
 | 
			
		||||
 | 
			
		||||
* tmux freezes my terminal when I attach to a session. I even have to kill -9
 | 
			
		||||
  the shell it was started from to recover!
 | 
			
		||||
@@ -96,9 +97,9 @@ flag may be specified when creating or attaching a client to a tmux session:
 | 
			
		||||
 | 
			
		||||
* How do I use a 256 colour terminal?
 | 
			
		||||
 | 
			
		||||
tmux will attempt to detect a 256 colour terminal both by looking at the Co
 | 
			
		||||
termcap entry and, as this is broken for some terminals such as xterm-256color,
 | 
			
		||||
by looking for the string "256col" in the termcap name.
 | 
			
		||||
tmux will attempt to detect a 256 colour terminal both by looking at the colors
 | 
			
		||||
terminfo entry and by looking for the string "256col" in the TERM environment
 | 
			
		||||
variable.
 | 
			
		||||
 | 
			
		||||
If both these methods fail, the -2 flag may be passed to tmux when attaching
 | 
			
		||||
to a session to indicate the terminal supports 256 colours.
 | 
			
		||||
@@ -106,8 +107,9 @@ to a session to indicate the terminal supports 256 colours.
 | 
			
		||||
* vim or $otherprogram doesn't display 256 colours. What's up?
 | 
			
		||||
 | 
			
		||||
Some programs attempt to detect the number of colours a terminal is capable of
 | 
			
		||||
by checking the Co termcap entry. However, this is not reliable, and in any
 | 
			
		||||
case is missing from the "screen" termcap used inside tmux.
 | 
			
		||||
by checking the colors terminfo or Co termcap entry. However, this is not
 | 
			
		||||
reliable, and in any case is missing from the "screen" terminal description
 | 
			
		||||
used inside tmux.
 | 
			
		||||
 | 
			
		||||
There are three options to allow programs to recognise they are running on
 | 
			
		||||
a 256-colour terminal inside tmux:
 | 
			
		||||
@@ -115,9 +117,9 @@ a 256-colour terminal inside tmux:
 | 
			
		||||
- Manually force the application to use 256 colours always or if TERM is set to
 | 
			
		||||
  screen. For vim, you can do this by overriding the t_Co option, see
 | 
			
		||||
  http://vim.wikia.com/wiki/256_colors_in_vim.
 | 
			
		||||
- If the platform includes it, using the "screen-256color" termcap (set
 | 
			
		||||
  TERM=screen-256color). "infocmp screen-256color" can be used to check if this
 | 
			
		||||
  is supported. It is possible to set this globally inside tmux using the
 | 
			
		||||
- If the platform includes it, using the "screen-256color" terminal description
 | 
			
		||||
  (set TERM=screen-256color). "infocmp screen-256color" can be used to check if
 | 
			
		||||
  this is supported. It is possible to set this globally inside tmux using the
 | 
			
		||||
  default-terminal session option, or it may be done in a shell startup script
 | 
			
		||||
  by checking if TERM is screen and exporting TERM=screen-256color instead.
 | 
			
		||||
- Creating a custom terminfo file that includes colors#256 in ~/.terminfo and using
 | 
			
		||||
@@ -202,4 +204,4 @@ on the Window -> Translation configuration page. For example, change UTF-8 to
 | 
			
		||||
ISO-8859-1 or CP437. It may also be necessary to adjust the way PuTTY treats
 | 
			
		||||
line drawing characters in the lower part of the same configuration page.
 | 
			
		||||
 | 
			
		||||
$Id: FAQ,v 1.25 2009-08-05 14:56:58 nicm Exp $
 | 
			
		||||
$Id: FAQ,v 1.26 2009-08-05 16:29:50 nicm Exp $
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user