If everything else is configured correctly, it should be as simple as putting it in your .tmux.conf :
set-option -g prefix Home
Note. If you do not manually submit your .tmux.conf , changes to the file will only affect the restart of the tmux server . Either exit all windows, windows (thus closing all sessions and exiting the server) or use tmux kill-server , and then start a new session.
This will only work if the terminal emulator sends an escape sequence that matches the khome field of the khome database entry for the TERM value that is valid when connecting to a tmux session (i.e., TERM "outside" tmux).
Generated home exit sequence
You can check the evacuation sequence sent by the terminal emulator by entering the "Home" key (and a new line) in cat -v (you can interrupt the cat with Control - C as soon as it shows you the sequence). General answers can be ^[[1~ or ^[OH .
The expected exit sequence for the home
The TERM environment variable tells terminfo programs (such as tmux) which escape sequences your terminal emulator (presumably) understands and generates. The equivalent sequence generated by the Home key is stored in the khome field. You can use tput or infocmp to retrieve the field values ββ(both use the current TERM , unless they are given an override terminal declaration).
tput khome | cat -v ; echo infocmp -1 | grep -F khome
Fix generated / expected discrepancy
If the escape sequence generated by your terminal emulator does not match the khome for the declared TERM value, there are several things you can do to try to fix the problem:
- Reconfigure the terminal emulator.
This may include using another program, choosing another emulation, or simply (re) defining the sequence that it sends when you press the Home key. - Choose a new
TERM value that better matches what your terminal emulator sends and understands. - Adjust the terminfo database entry to match the terminal emulation.
You can use infocmp to extract both the existing terminfo and tic entries to compile your modified entry. - Tell tmux to adjust its copies during the execution of terminfo database entries.
tmux provides a terminal-overrides parameter that can be used to override individual terminfo fields for different TERM values.
For example, if your terminal emulator does not send a sequence for Home, but you can configure it, and the terminfo entry for your TERM does not have a khome field, then you can tell the terminal emulator to send ESC [ 1 ~ , and use termname:khome=\033[1~ for your terminal-overrides value (where termname is the pattern that matches your TERM value).
eg. in .tmux.conf:
set-option -g terminal-overrides "xterm-color:khome=\033[1~"
You can use tmux server-info to check for runtime instances of tmuxs terminfo entries.
Note. As above (with the prefix change), the easiest way to allow this change is to restart your tmux server.