@@ -165,18 +165,22 @@ initTermInput escDelay terminal = do
165165 , k "E" KBegin
166166 ],
167167
168− -- Support for arrows
168+ -- Support for arrows and KHome/KEnd
169169 [("\ESC[" ++ charCnt ++ show mc++c,(s,m))
170170 | charCnt <- ["1;", ""], -- we can have a count or not
171171 (m,mc) <- [([MShift],2::Int), ([MCtrl],5), ([MMeta],3),
172172 ([MShift, MCtrl],6), ([MShift, MMeta],4)], -- modifiers and their codes
173− (c,s) <- [("A", KUp), ("B", KDown), ("C", KRight), ("D", KLeft)] -- directions and their codes
173+ (c,s) <- [("A", KUp), ("B", KDown), ("C", KRight), ("D", KLeft), ("H", KHome), ("F", KEnd)] -- directions and their codes
174174 ],
175175
176176 let k n s = ("\ESC["++show n++"~",(s,[]))
177177 in zipWith k [2::Int,3,5,6,1,4]
178178 [KIns,KDel,KPageUp,KPageDown,KHome,KEnd],
179179
180+ let k n s = ("\ESC["++show n++";5~",(s,[MCtrl]))
181+ in zipWith k [2::Int,3,5,6,1,4]
182+ [KIns,KDel,KPageUp,KPageDown,KHome,KEnd],
183+
180184 -- Support for simple characters.
181185 [ (x:[],(KASCII x,[])) | x <- map toEnum [0..255] ],
182186