Browse Source

* Fix exiting acs after screen update

git-svn-id: trunk@3345 -
daniel 19 years ago
parent
commit
b03ab6296f
1 changed files with 10 additions and 2 deletions
  1. 10 2
      rtl/unix/video.pp

+ 10 - 2
rtl/unix/video.pp

@@ -728,6 +728,16 @@ begin
     inc(LastX);
     inc(LastX);
    end;
    end;
   OutData(XY2Ansi(CursorX+1,CursorY+1,LastX,LastY));
   OutData(XY2Ansi(CursorX+1,CursorY+1,LastX,LastY));
+  if in_ACS then
+    begin
+      {If the program crashes and the ACS is still enabled, the user's
+       keyboard will output strange characters. Therefore we disable the
+       acs after each screen update, so the risk that it happens is greatly
+       reduced.}
+{      SendEscapeSeqNdx(exit_alt_charset_mode);}
+      outdata(acsout);
+      in_acs:=false;
+    end;
 {$ifdef logging}
 {$ifdef logging}
   blockwrite(f,logstart[1],length(logstart));
   blockwrite(f,logstart[1],length(logstart));
   blockwrite(f,nl,1);
   blockwrite(f,nl,1);
@@ -737,8 +747,6 @@ begin
   blockwrite(f,nl,1);
   blockwrite(f,nl,1);
 {$endif logging}
 {$endif logging}
   fpWrite(stdoutputhandle,outbuf,outptr);
   fpWrite(stdoutputhandle,outbuf,outptr);
-  if in_ACS then
-    SendEscapeSeqNdx(exit_alt_charset_mode);
  {turn autowrap on}
  {turn autowrap on}
 //  SendEscapeSeq(#27'[?7h');
 //  SendEscapeSeq(#27'[?7h');
 end;
 end;