From d772104ce7f1b8d6135259c98691bb65f3fa85d2 Mon Sep 17 00:00:00 2001 From: daniel Date: Sun, 5 Mar 2006 22:00:20 +0000 Subject: [PATCH] * Send escape code to xterm to make alt+key send an escape prefix. git-svn-id: trunk@2777 - --- rtl/unix/keyboard.pp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rtl/unix/keyboard.pp b/rtl/unix/keyboard.pp index 04a49a5ec0..14752d9db6 100644 --- a/rtl/unix/keyboard.pp +++ b/rtl/unix/keyboard.pp @@ -1247,6 +1247,10 @@ begin { default for Ctrl Prefix is ^W } if CtrlPrefix=0 then CtrlPrefix:=23; + if copy(fpgetenv('TERM'),1,4)='xterm' then + {The alt key should generate an escape prefix. Save the old setting + make make it send that escape prefix.} + write(#27'[?1036s'#27'[?1036h'); {$ifdef linux} end; {$endif} @@ -1260,6 +1264,11 @@ begin {$ifdef linux} unpatchkeyboard; {$endif linux} + + if copy(fpgetenv('TERM'),1,4)='xterm' then + {Restore the old alt key behaviour.} + write(#27'[?1036r'); + SetRawMode(false); FreeTree;