From 0c2054b9a33dce6cb5afbdad7bcf2e1f921c8ece Mon Sep 17 00:00:00 2001 From: nickysn Date: Sat, 21 Feb 2015 21:13:34 +0000 Subject: [PATCH] + allow disabling the Extended/SGH 1006 mouse tracking mode introduced in r29773 by setting the environment variable FPC_DISABLE_SGR_EXT_MODE_MOUSE=1 git-svn-id: trunk@29778 - --- packages/rtl-console/src/unix/mouse.pp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/rtl-console/src/unix/mouse.pp b/packages/rtl-console/src/unix/mouse.pp index c9f3e125a5..9d98a6507d 100644 --- a/packages/rtl-console/src/unix/mouse.pp +++ b/packages/rtl-console/src/unix/mouse.pp @@ -47,6 +47,7 @@ const WaitMouseMove : boolean = false; PrintMouseCur : boolean = false; mousecurofs : longint = -1; + DisableSGRExtModeMouse : boolean = false; var mousecurcell : TVideoCell; @@ -197,6 +198,9 @@ var connect:TGPMConnect; {$endif ndef NOGPM} begin + if fpGetEnv('FPC_DISABLE_SGR_EXT_MODE_MOUSE')='1' then + DisableSGRExtModeMouse:=true; + { if gpm_fs<>-1 then runerror(240);} {Test wether to use X-terminals.} @@ -207,14 +211,16 @@ begin gpm_fs:=-1000; {write(#27'[?1001s');} { save old hilit tracking } write(#27'[?1000h'); { enable mouse tracking } - write(#27'[?1006h'); { try to enable Extended/SGH 1006 mouse tracking } + if not DisableSGRExtModeMouse then + write(#27'[?1006h'); { try to enable Extended/SGH 1006 mouse tracking } end; 1003: begin {Use the xterm mouse, report all mouse events.} gpm_fs:=-1003; write(#27'[?1003h'); { enable mouse tracking } - write(#27'[?1006h'); { try to enable Extended/SGH 1006 mouse tracking } + if not DisableSGRExtModeMouse then + write(#27'[?1006h'); { try to enable Extended/SGH 1006 mouse tracking } end; end; {$ifndef NOGPM} @@ -249,12 +255,14 @@ begin {xterm mouse} write(#27'[?1000l'); { disable mouse tracking } {write(#27'[?1001r');} { Restore old hilit tracking } - write(#27'[?1006l'); { disable Extended/SGH 1006 mouse tracking } + if not DisableSGRExtModeMouse then + write(#27'[?1006l'); { disable Extended/SGH 1006 mouse tracking } end; -1003: begin write(#27'[?1003l'); { disable mouse tracking } - write(#27'[?1006l'); { disable Extended/SGH 1006 mouse tracking } + if not DisableSGRExtModeMouse then + write(#27'[?1006l'); { disable Extended/SGH 1006 mouse tracking } end; {$ifndef NOGPM} else