In the win Environment Putty login to Linux and use Emacs, you need to toss a good configuration to work properly. Here are the problems encountered during the tossing process and the solution steps:
1) to enable the mouse in the Putty console, you only need to enable Xterm-mouse-mode in the. Emacs Configuration file:
(Xterm-mouse-mode t)
This way, when you click the Emacs menu in the console, you will see a buffer indicating the corresponding menu options.
2) Right ALT key failure problem: I refer to the article on Emacs-wiki: Https://www.emacswiki.org/emacs/PuTTY
Create a text file Fix-alt-key.reg, write:
Windows Registry Editor Version 5.00[hkey_local_machine\system\currentcontrolset\control\keyboard Layout] "Scancode Map "=hex:00,00,00,00,00,00,00,00,02,00,00,00,38,00,38,e0,00,00,00,00
Double-click to execute.
3) Some function keys, such as HOME,END,FN, do not work properly. First, set the keyboard type in putty to SCO, which is the only mode that can identify all function keys. Then add the key mapping configuration in the. emacs File:
(if (eq system-uses-terminfo t) (PROGN;; PuTTY hack-needs to BES in SCO mode (Define-key key-translation-map [\e] [\m]) (Define-key input-decode-map "\e [H "[Home]) (Define-key input-decode-map "\e[f" [end]) (Define-key input-decode-map "\e[d" [S-left]) (Define-key input-decod E-map "\e[c" [S-right]) (Define-key input-decode-map "\e[a" [s-up]) (Define-key input-decode-map "\e[B" [S-down] ) (Define-key input-decode-map "\e[c" [S-right]) (Define-key input-decode-map "\e[i" [Prior]) (Define-key I Nput-decode-map "\e[g" [Next]) (Define-key input-decode-map "\e[m" [F1]) (Define-key input-decode-map "\e[Y" [s F1]) (Define-key input-decode-map "\e[k" [C-f1]) (Define-key input-decode-map "\e\e[m" [M-f1]) (Define-key Input-decode-map "\e[n" [F2]) (Define-key input-decode-map "\e[z" [S-f2]) (Define-key input-decode-map "\e[l" [C -F2]) (Define-key input-decode-map "\e\e[n" [M-f2]) (Define-key input-decode-map "\e[o" [F3]) (Define-key input-decode-map "\e[a" [S-f3]) (Define-key input-d Ecode-map "\e[m" [C-f3]) (Define-key input-decode-map "\e\e[o" [M-f3]) (Define-key input-decode-map "\e[P" [F4]) (Define-key input-decode-map "\e[b" [S-f4]) (Define-key input-decode-map "\e[n" [C-f4]) (Define-key input- Decode-map "\e\e[p" [M-f4]) (Define-key input-decode-map "\e[q" [F5]) (Define-key input-decode-map "\e[c" [S-f5] ) (Define-key input-decode-map "\e[o" [C-f5]) (Define-key input-decode-map "\e\e[q" [M-f5]) (Define-key INP Ut-decode-map "\e[r" [F6]) (Define-key input-decode-map "\e[d" [S-f6]) (Define-key input-decode-map "\e[p" [C-f6 ]) (Define-key input-decode-map "\e\e[r" [M-f6]) (Define-key input-decode-map "\e[s" [F7]) (Define-key Inpu T-decode-map "\e[e" [S-f7]) (Define-key input-decode-map "\e[q" [C-f7]) (Define-key input-decode-map "\e\e[S" [M -F7]) (Define-key iNput-decode-map "\e[t" [F8]) (Define-key input-decode-map "\e[f" [S-f8]) (Define-key input-decode-map "\e[r" [C F8]) (Define-key input-decode-map "\e\e[t" [M-f8]) (Define-key input-decode-map "\e[u" [F9]) (Define-key in Put-decode-map "\e[g" [S-f9]) (Define-key input-decode-map "\e[s" [C-f9]) (Define-key input-decode-map "\e\e[U" [M-F9]) (Define-key input-decode-map "\e[v" [F10]) (Define-key input-decode-map "\e[h" [S-f10]) (Define-key Input-decode -map "\e[_" [C-f10]) (Define-key input-decode-map "\e\e[v" [M-f10]) (Define-key input-decode-map "\e[W" [F11]) (Define-key input-decode-map "\e[i" [S-f11]) (Define-key input-decode-map "\e[u" [C-f11]) (Define-key input- Decode-map "\e\e[w" [M-f11]) (Define-key input-decode-map "\e[x" [F12]) (Define-key input-decode-map "\e[j" [S-f (Define-key input-decode-map "\e[v" [C-f12]) (Define-key input-decode-map "\e\e[x" [M-f12])))
After that, the function keys will be recognized normally. Putty's documentation can be seen here: Http://the.earth.li/~sgtatham/putty/0.62/htmldoc/Chapter4.html#config-keyboard
After solving these problems, there is no big problem in using Emacs in putty. However, I found that "Ctrl-number-keying" cannot be executed, "Ctrl-Number" is interpreted as other functions. This point also requires further investigation.
Putty and Emacs