[erlang-patches] stdlib 1.19.3, edlin.erl Key mapping extension for some unix-terminals.

Alexander Demidenko alex.demidenko@REDACTED
Wed Nov 27 04:35:55 CET 2013


Hello, friends!

Key mapping extension for some terminals.
Add support new code sequences for: <Home>, <Forward>, <Delete>,
<Ctrl>+<Delete>

--- lib/stdlib/src/edlin.erl
+++ lib/stdlib/src/edlin.erl
@@ -232,12 +212,26 @@
 key_map($F, meta_o) -> end_of_line;
 key_map($\177, none) -> backward_delete_char;
 key_map($\177, meta) -> backward_kill_word;
 key_map($[, meta) -> meta_left_sq_bracket;
 key_map($D, meta_left_sq_bracket) -> backward_char;
 key_map($C, meta_left_sq_bracket) -> forward_char;
+
+% Eltex patch
+% support a <Home>
+key_map($H, meta_left_sq_bracket) -> beginning_of_line;
+% support a <Forward>
+key_map($F, meta_left_sq_bracket) -> end_of_line;
+% support a <Delete>
+key_map($3, meta_left_sq_bracket) -> {csi, "3"};
+key_map($~, {csi, "3"}) -> forward_delete_char;
+% support a <Ctrl>+<Delete>
+key_map($;, {csi, "3"}) -> {csi, "3;"};
+key_map($5, {csi, "3;"}) -> {csi, "3;5"};
+key_map($~, {csi, "3;5"}) -> kill_word;
+
 % support a few <CTRL>+<CURSOR LEFT|RIGHT> combinations...
 %  - forward:  \e\e[C, \e[5C, \e[1;5C
 %  - backward: \e\e[D, \e[5D, \e[1;5D
 key_map($\e, meta) -> meta_meta;
 key_map($[, meta_meta) -> meta_csi;
 key_map($C, meta_csi) -> forward_word;



-- 
---------------------------------------------
With best regards,
Alexander.
Eltex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20131127/bf5c57dd/attachment.htm>


More information about the erlang-patches mailing list