Browse Source

* Set standard I/O line ending to #13#10 when keyboard in raw mode.

git-svn-id: trunk@3698 -
daniel 19 years ago
parent
commit
cb1b6419ed
1 changed files with 13 additions and 6 deletions
  1. 13 6
      rtl/unix/keyboard.pp

+ 13 - 6
rtl/unix/keyboard.pp

@@ -98,19 +98,26 @@ const
 {$endif Unused}
 {$endif Unused}
 
 
 procedure SetRawMode(b:boolean);
 procedure SetRawMode(b:boolean);
-var
-  Tio : Termios;
-Begin
+
+var Tio:Termios;
+
+begin
   TCGetAttr(1,Tio);
   TCGetAttr(1,Tio);
   if b then
   if b then
    begin
    begin
+     {Standard output now needs #13#10.}
+     settextlineending(output,#13#10);
      OldIO:=Tio;
      OldIO:=Tio;
      CFMakeRaw(Tio);
      CFMakeRaw(Tio);
    end
    end
   else
   else
-    Tio := OldIO;
-  TCSetAttr(1,TCSANOW,Tio);
-End;
+    begin
+      Tio := OldIO;
+      {Standard output normally needs just a linefeed.}
+      settextlineending(output,#10);
+    end;
+  TCsetattr(1,TCSANOW,Tio);
+end;
 
 
 {$ifdef linux}
 {$ifdef linux}