浏览代码

+ 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 -

nickysn 10 年之前
父节点
当前提交
0c2054b9a3
共有 1 个文件被更改,包括 12 次插入4 次删除
  1. 12 4
      packages/rtl-console/src/unix/mouse.pp

+ 12 - 4
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