--------------------------------------------------------------------------
	Frequently Asked Questions (FAQ)

	Hint: please set tab stop to 4 for a best display of this file.

	$Id: FAQ,v 1.31 2004/10/21 09:22:20 cvs Exp $
--------------------------------------------------------------------------

-----

	Q:	I have a question...

	A:  Have you read the README, README.configure, INSTALL, FAQ, 
	TIPS, man page...? Before asking a question, please read through
	these documents for potential answers.

	Here is a good tutorial to ask questions:
		http://www.catb.org/~esr/faqs/smart-questions.html

-----

	Q:	How to build mrxvt, since I cannot find the configure script
	as usual!?

	A:  Have you read the INSTALL file?

-----

	Q:	When I run mrxvt from command line, it outputs lots of verbose
	text. How to disable it?

	A:  You probably have configured mrxvt with debug support. You
	need to reconfigure mrxvt to disable debug support and rebuild
	it, like the following:

		$ ./configure --enable-whatever-options --disable-debug
		$ make

-----

	Q:	I do not have root privilege on my system. Can I install mrxvt,
	and what are the restrictions if I install it as normal user?

	A:  Surely you can install mrxvt without root privilege. You can
	configure mrxvt with --prefix=/home/youraccount and install it.
	Or you can simply copy the mrxvt program to anywhere you wish.
	Mrxvt requires setuid root in order to write to utmp/wtmp/lastlog.
	Since you do not have root privilege, you will lose these logging
	features.

-----

	Q:	When I run mrxvt with multiple tabs, why does the output of
	the `w' command shows many users are using the system?

	A:  This is because each mrxvt tab logs itself in an entry of the
	utmp file. If you do not want this feature, remove the setuid
	permission from mrxvt binary and do not build mrxvt with utempter
	support.

-----

	Q:	When I want to use Chinese (or Korea/Japanese) encoding and
	font, executing command `mrxvt -km gb -mfont fontname' is not
	working! For example, it complains that -km is a bad option.

	A:  Most probably, you have not enabled gb/big5/kanji/korea options
	when you configure the mrxvt. These options are turned off by
	default. Reconfigure mrxvt to enable these options and rebuild it
	like the following:

		$ ./configure --enable-gb --enable-whatever-other-options
		$ make
		$ su
		# make install

	Important note: Chinese/Korea/Japanese are not supported if you
	use freetype font. So you need to disable XFT if you want to
	correctly see Chinese/Korea/Japanese.

-----

	Q:  How do I input Chinese (or Korea/Japanese) in mrxvt?

	A:  First of all, you need to to enable the language options for
	Chinese/Korea/Japanese as the above question when you configure
	mrxvt. You also needs to enable the XIM option (--enable-xim).

	Then make sure you have correctly setup and started the XIM server,
	like SCIM, Chinput, fcitx, etc. 

	Next, set the correct locale for mrxvt. You only need to set the
	environment variable LC_CTYPE. But after you set it, make sure
	that the environment variable LC_ALL is not set.

	Finally, set the correct X resources in ~/.Xdefaults file as the
	followling. Remember the value of inputMethod is case sensitive.

		mrxvt*multichar_encoding: GB
		mrxvt*inputMethod:        SCIM

-----

	Q:  When I run mrxvt in transparent mode or background image mode,
	can I make the background a little darker?

	A:  Yes, you can. This feature is called background fading. You
	can specify the darker number in the backgroundFade X resource
	or the -bgfade command line option. Notice that background fading
	does not work for solid color background. Furthermore, background
	fading is different from off-focus fading, which fades the
	background only when mrxvt loses focus.

-----

	Q:  Why the tinting does not work after I set the tint color in
	command line or ~/.Xdefaults?

	A:  First, tinting only works for user supplied background image
	or transparent background. Secondly, you have to set the shade
	option as well.

-----

	Q:  How to start mrxvt with multiple tabs initially?

	A  You can set the number of tabs you want in ~/.Xdefaults as
	the following example:

		mrxvt*initTermNumber:  3

	Alternatively, you can set it using command line option -tnum.

-----

	Q:  How to set the title of each tab when mrxvt starts?

	A:  You can set title for each tab in ~/.Xdefaults as the following
	example:

		mrxvt*vt0*tabTitle:		term1
		mrxvt*vt1*tabTitle:		term2
		mrxvt*vt2*tabTitle:		term3
		mrxvt*vt3*tabTitle:		term4

	Alternatively, you can set title for each tab using command line
	options:

		$ mrxvt -vt0.tt "term1" -vt1.tt "term2" -tnum 2

-----

	Q:  How to let each tab execute different applications when mrxvt
	starts?

	A:  You can set session for each tab in ~/.Xdefaults as the
	following example:

		mrxvt*vt0*session:		/bin/bash
		mrxvt*vt1*session:		/bin/tcsh
		mrxvt*vt2*session:		/bin/bash -c "/usr/bin/mc"
		mrxvt*vt3*session:		/usr/bin/telnet www.mitbbs.com

	Alternatively, you can set session for each tab using command line
	options:

		$ mrxvt -vt0.ss "/bin/bash" -vt1.ss '/bin/bash -c "telnet www.mitbbs.com"' -tnum 2

	Notice that by default, -e command will override the first session
	command. You can change this behavior to let -e command override
	all session command by -cs option or cmdAllSession resource.

-----

	Q:  How to change the title of a tab after mrxvt starts?

	A:  You can select some text in the mrxvt terminal and press the
	hot key combinations: Ctrl_Meta_c or Shift_Delete. The tab title
	will be changed to the selected text. Currently, the selected text
	must be in the mrxvt terminal.

	You can also change the tab title through escape sequence. Please
	compile the sample settitle.c in doc/ directory and run it as
	follows:

		$ settitle new_tab_title

	The most convenient way to change tab title is to select text in
	the mrxvt terminal and click the middle button of your mouse on
	the tab that you want to change the title. If you click on blank
	area of the tabbar, the title of the active tab will be changed.
	Of course, this requires middle button support by your X Window
	System.

-----

	Q:  How to change the title of a tab to the current directory
	automatically?

	A:  You can achieve it by hack the prompt of your shell. For
	example, if you use bash, you can set PS1 as this (thanks to
	Watson@mitbbs.com):

		export PS1="\033]61;\w\007\u@\h:\w\$ "

	Notice that `\w' shows the full path of current directory. If you
	only want the basename of current directory, use `\W' instead.

	For C shell, you can hack the `precmd' and `prompt'. This is a
	homework. ;-)

-----

	Q:  How to dynamically change the title of the mrxvt window so
	that it is the same as the current active tab when I switch to
	a new tab?

	A:  You can set X resources `syncTabTitle' to true or run mrxvt
	with -stt option.

-----
	Q:  Why cannot I close a tab? The close button is grey!

	A:  Most probably, you have enable the protectSecondary resource
	and you are running an application, like vi and mc that is using
	the secondary screen in the current tab. Mrxvt considers this
	tab being protected and disallow you to close it. To close the
	tab, please exit the application first. To disable this option,
	you can modify the ~/.Xdefaults file or run mrxvt with +ps option.

-----

	Q:  Is there any keyboard combination to manipulate the tabs?

	A:  Yes. Please read the TIPS file in the doc/ directory. Mrxvt
	currently support the default gnome-terminal and konsole hotkey
	combinations.

-----

	Q:  Why a feature, an X resource, a command line option, or a
	hotkey combination does not work anymore as it worked before?

	A:  Don't panic! Most probably, it has been changed to another name,
	but not disappearing. Current branch (0.3.x) is not considered as a
	stable branch, so features may subject to changes. Please read the
	documents for more details, they should have been updated
	accordingly.

-----

	Q:  Can I change the color of tab background and text?

	A:  Yes you can. You can use command line option to set foreground
	and background color of active or inactive tabs like this:

		$ mrxvt -tabfg blue -tabbg grey -itabfg black -itabbg dark
	
	Or you can set them in ~/.Xdefaults like this:
		! text color of active tab
		mrxvt*tabForeground:  blue
		! background color of active tab
		mrxvt*tabBackground:  grey
		! text color of inactive tab
		mrxvt*itabForeground: black
		! background color of inactive tab
		mrxvt*itabBackground: dark

-----

	Q:  I like to use command line options to create a new tab in the
	current mrxvt terminal and execute some commands. For example,
	if I run command `mrxvt --new-tab -e pine' in a mrxvt terminal,
	the current terminal will open a new tab and run pine in it.
	Can you implement it for me?

	A:  Unfortunately, no. This is a dangerous feature that can cause
	serious security problems. By now, you can only use escape sequence
	to create a new tab and execute the default program specified by 
	the ~/.Xdefaults or the default shell in it. For details about
	the security problem, consult to the following link:

		http://www.digitaldefense.net/labs/papers/Termulation.txt

-----

	Q:  I like to use context menu when I right click in the terminal
	window. For example, to copy/paste text. Can you support it?

	A:  To implement context menu using plain Xlib is very difficult.
	If using GTK/QT, it is relative easy. So there is a trade off
	between the features and library dependency, and I do not want to
	let mrxvt depend on GTK/QT by now. So probably context menu will
	not be supported in the near future.

-----

	Q:	How do I know which mrxvt version I'm using?

	A:	The version number is displayed with the usage (-h).
	For rxvt version 2.14 and later, the escape sequence `ESC[8n'
	sets the window title to the version number.

-----

	Q:	Mouse cut/paste suddenly no longer works.

	A:	Make sure that mouse reporting is actually turned off since
	killing some editors prematurely may leave the mouse in mouse
	report mode.  I've heard that tcsh may use mouse reporting
	unless it otherwise specified.  A quick check is to see if
	cut/paste works when the Alt or Shift keys are depressed. See
	doc/refer.txt

-----

	Q:	What's with this bold/blink stuff?  I can never get blinking
	text!

	A:	It is not possible, and likely will never be, for mrxvt to have
	actual blinking text. Instead (if mrxvt was compiled without
	NO_BOLDCOLOR), bold/blink attributes are used to set high-intensity
	foreground/background colors ... like what you'd see on a PC video
	adapter.  There are programs, notably John Davis' SLang-based ones
	<ftp://space.mit.edu/pub/davis>, that use bold/blink attributes to
	permit 16 colors.

	color0-7 are the low-intensity colors.
	color8-15 are the corresponding high-intensity colors.

	A side issue of this bold/blink stuff is the question of how the
	normal default foreground/background colors are to be treated.  If
	the default foreground/background match one of the low-intensity
	colors (color0-7), the bold/blink attribute will invoke the
	appropriate high-intensity color (color8-15).

	In the case that the default foreground doesn't match one of the
	low-intensity colors, the bold attribute will use an `overstrike'
	to simulate a bold font. But note this leaves pixel-droppings and
	so, rather than wasting an inordinate amounts of energy to fix it,
	its use is simply deprecated.

	In the case that the default background doesn't match one of the
	low-intensity colors, the blink attribute is simply ignored
	(rather than representing it as bold as xterm does).

-----

	Q:	I don't like the screen colors.  How do I change them?

	A:	You can change the screen colors at run-time using ~/.Xdefaults
	resources (or as long-options) ... see the man-page.

	Here are values that are supposed to resemble a VGA screen,
	including the murky brown that passes for low-intensity yellow:

		Mrxvt*color0:	#000000
		Mrxvt*color1:	#A80000
		Mrxvt*color2:	#00A800
		Mrxvt*color3:	#A8A800
		Mrxvt*color4:	#0000A8
		Mrxvt*color5:	#A800A8
		Mrxvt*color6:	#00A8A8
		Mrxvt*color7:	#A8A8A8

		Mrxvt*color8:	#000054
		Mrxvt*color9:	#FF0054
		Mrxvt*color10:	#00FF54
		Mrxvt*color11:	#FFFF54
		Mrxvt*color12:	#0000FF
		Mrxvt*color13:	#FF00FF
		Mrxvt*color14:	#00FFFF
		Mrxvt*color15:	#FFFFFF

-----

	Q:	What's with the strange Backspace/Delete key behaviour?

	A:	Assuming that the physical Backspace key corresponds to the
	BackSpace keysym (not likely for Linux ... see the following
	question) there are two standard values that can be used for
	Backspace: ^H and ^?.

	Mrxvt tries to inherit the current stty settings and uses the value
	of `erase' to guess the value for backspace.  If mrxvt wasn't
	started from a terminal (say, from a menu or by remote shell),
	then the system value of `erase', which corresponds to CERASE in
	<termios.h>, will be used (which may not be the same as your stty
	setting).

	For starting a new mrxvt:

		use Backspace = ^H
		$ stty erase ^H
		$ mrxvt
		or
		$ mrxvt --backspacekey ^H -e bash

		use Backspace = ^?
		$ stty erase ^?
		$ mrxvt
		$ mrxvt --backspacekey ^? -e bash

	NB: generate either value with BackSpace and Ctrl/Shift-BackSpace.
	    Toggle with "ESC[36h" / "ESC[36l" as documented in "doc/refer.txt"

	For an existing mrxvt:
		use Backspace = ^H
		$ stty erase ^H
		$ echo -n "^[[36h"

		use Backspace = ^?
		$ stty erase ^?
		$ echo -n "^[[36l"

	This helps satisfy some of the Backspace discrepancies that occur,
	but if you use Backspace = ^?, make sure that the termcap/terminfo
	value properly reflects that.

	The Delete key (which one would expect to emit ^?) is a another
	casualty of the ill-defined Backspace problem.  To avoid confusion
	between the Backspace and Delete keys, the Delete key has been
	assigned an escape sequence to match the vt100 for Execute (ESC[3~)
	and is in the supplied termcap/terminfo.

	Some other Backspace problems:
		some editors use termcap/terminfo,
		some editors (vim I'm told) expect Backspace = ^H,
		GNU Emacs (and Emacs-like editors) use ^H for help.

	Perhaps someday this will all be resolved in a consistent manner
	... and maybe xterm will have Home/End values too!

-----

	Q:	Why doesn't the Backspace key work on my Linux machine?

	A:	The XFree86 server has a notorious problem of mapping the
	Backspace key as Delete in order to match the Linux console.

	The correct way to fix this:

		0 - Complain to your Linux distributer and the XFree86 team,
		maybe they'll fix it.

		1 - Use xmodmap to correct the Backspace mapping

			! ~/.Xmodmap

			! a correctly-mapped BackSpace
			keycode 22 = BackSpace

			*** Make sure the keycode above matches the physical
			Backspace key on your machine!! (use xev) ***

	This will also fix the BackSpace problem with Motif applications,
	such as ``why doesn't Backspace work for Netscape?''

	You now have a Backspace key that functions as described in the
	previous question.

		1a - You may also want to fix the regular xterm if it doesn't
		generates the desired value for BackSpace

			xterm*vt100.translations: #override \
			<Key>BackSpace: string(\010) \n
	    or
			xterm*vt100.translations: #override \
			<Key>BackSpace: string(\177) \n

	   while you are at it, you may also want to have consistent
	   values to Home/End/Delete

			xterm*vt100.translations: #override \
			<Key>Home:	string("\033[7~") \n\
			<Key>End:	string("\033[8~") \n\
			<Key>Delete:	string("\033[3~") \n

	Finally, you can also remap the mrxvt key-binding at run-time (next
	question) but you'll lose the ability to have Ctrl/Shift-Backspace
	work differently as well as losing the escape sequence toggling of
	Backspace.

-----

	Q:	I don't like the key-bindings.  How do I change them?

	A:	There are some compile-time selections available via configure.
	Unless you have run "configure" with the "--disable-resources"
	option you can use the `keysym' resource to alter the keystrings
	associated with keysym 0xFF00 - 0xFFFF (function, cursor keys, etc).

	Here's an example for a tn3270 session started using
	`mrxvt -name tn3270'

			!#  ----- special uses ------:
			! tn3270 login, remap function and arrow keys.
			tn3270*font:	*clean-bold-*-*--15-*

			! keysym - used by mrxvt only
			! Delete - ^D
			tn3270*keysym.0xFFFF:	\004

			! Home - ^A
			tn3270*keysym.0xFF50:	\001
			! Left - ^B
			tn3270*keysym.0xFF51:	\002
			! Up - ^P
			tn3270*keysym.0xFF52:	\020
			! Right - ^F
			tn3270*keysym.0xFF53:	\006
			! Down - ^N
			tn3270*keysym.0xFF54:	\016
			! End - ^E
			tn3270*keysym.0xFF57:	\005

			! F1 - F12
			tn3270*keysym.0xFFBE:	\e1
			tn3270*keysym.0xFFBF:	\e2
			tn3270*keysym.0xFFC0:	\e3
			tn3270*keysym.0xFFC1:	\e4
			tn3270*keysym.0xFFC2:	\e5
			tn3270*keysym.0xFFC3:	\e6
			tn3270*keysym.0xFFC4:	\e7
			tn3270*keysym.0xFFC5:	\e8
			tn3270*keysym.0xFFC6:	\e9
			tn3270*keysym.0xFFC7:	\e0
			tn3270*keysym.0xFFC8:	\e-
			tn3270*keysym.0xFFC9:	\e=

			! map Prior/Next to F7/F8
			tn3270*keysym.0xFF55:	\e7
			tn3270*keysym.0xFF56:	\e8

-----

	Q:	I'm using keyboard model XXX that has extra Prior/Next/Insert
	keys.  How do I make use of them?  For example, the Sun Keyboard
	type 4 has the following mappings that mrxvt doesn't recognize.

		KP_Insert == Insert
		F22 == Print
		F27 == Home
		F29 == Prior
		F33 == End
		F35 == Next

	A:	Rather than have mrxvt try to accomodate all the various
	possible keyboard mappings, it is better to use `xmodmap' to
	remap the keys as required for your particular machine.

-----

	Q:	How do I distinguish if I'm running mrxvt or a regular xterm?
	I need this to decide about setting colors etc.

	A:	mrxvt always exports the variable "COLORTERM", so you can check
	and see if that is set.  Note that several programs, JED, slrn,
	Midnight Commander automatically check this variable to decide
	whether or not to use color.

-----

	Q:	How do I set the correct, full IP address for the DISPLAY
	variable?

	A:	If you've compiled mrxvt with DISPLAY_IS_IP then it is
	possible to use the following shell script snippets to correctly set
	the display.  If your version of mrxvt wasn't also compiled with
	ESCZ_ANSWER (as assumed in these snippets) then the COLORTERM
	variable can be used to distinguish mrxvt from a regular xterm.

	Courtesy of Chuck Blake <cblake@BBN.COM> with the following shell
	script snippets:

		# Bourne/Korn/POSIX family of shells:
		# assume an xterm if we don't know
		[ ${TERM:-foo} = foo ] && TERM=xterm
		if [ ${TERM:-foo} = xterm ]; then
			# see if enhanced mrxvt or not
			stty -icanon -echo min 0 time 15
			echo -n '^[Z'
			read term_id
			stty icanon echo
			if [ ""${term_id} = '^[[?1;2C' -a ${DISPLAY:-foo} = foo ]; then
				# query the mrxvt we are in for the DISPLAY string
				echo -n '^[[7n'	
				# set it in our local shell
				read DISPLAY	
			fi
		fi

	csh/tcsh family of shells:

		# if term is unset, we are probably in an xterm
		if ( !(${?TERM}) ) then	
			TERM = xterm
		endif
		if ( ${TERM} =~ xterm ) then
			# see if enhanced mrxvt or not
			stty -icanon -echo min 0 time 15  
			echo -n '^[Z'
			set term_id=$<
			stty icanon echo
			if ( ""${term_id} == "^[[?1;2C" && ${?DISPLAY} == 0 ) then
				# query the mrxvt we're in for the DISPLAY string
				echo -n '^[[7n'	
				# set it in our local shell
				setenv DISPLAY "$<"
			endif
		endif

-----

	Q:  Where is the CVS repository of mrxvt? I cannot find it on
	sourceforge!

	A:  By now (0.3.5) mrxvt CVS repository is still private. We will
	upload it to sourceforge when we feel mrxvt is stable enough and
	the features are almost ready. It may happen when we reach version
	0.4.0.

-----

	Q:  I find a bug, or I would like to see a new feature in mrxvt, how
	to report it?

	A:  You can go to http://sourceforge.net/projects/materm and report
	the bug using tracker system. Alternatively, you can send e-mail to
	my sourceforge address: jimmyzhou@users.sourceforge.net. Sourceforge
	tracker system is preferred.
	
	Also, please describe the details of the bug you find as much as
	you can so that I can be sure to understand the bug and repeat
	it by myself. For example, the version of mrxvt, system you are
	running, operation steps to repeat the bug. Otherwise, I have no
	way to fix the bug, especially those tricky ones.

--
EOF
