mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 05:59:37 +01:00 
			
		
		
		
	* Set standard I/O line ending to #13#10 when keyboard in raw mode.
git-svn-id: trunk@3698 -
This commit is contained in:
		
							parent
							
								
									3c07574d4f
								
							
						
					
					
						commit
						cb1b6419ed
					
				@ -98,19 +98,26 @@ const
 | 
			
		||||
{$endif Unused}
 | 
			
		||||
 | 
			
		||||
procedure SetRawMode(b:boolean);
 | 
			
		||||
var
 | 
			
		||||
  Tio : Termios;
 | 
			
		||||
Begin
 | 
			
		||||
 | 
			
		||||
var Tio:Termios;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
  TCGetAttr(1,Tio);
 | 
			
		||||
  if b then
 | 
			
		||||
   begin
 | 
			
		||||
     {Standard output now needs #13#10.}
 | 
			
		||||
     settextlineending(output,#13#10);
 | 
			
		||||
     OldIO:=Tio;
 | 
			
		||||
     CFMakeRaw(Tio);
 | 
			
		||||
   end
 | 
			
		||||
  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}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user