View Issue Details

IDProjectCategoryView StatusLast Update
0015568FPCRTLpublic2013-05-31 23:27
ReporterSalvatore Licciardi Assigned Toolivier  
Status feedbackResolutionopen 
OSBeOs / Haiku 
Product Version2.4.0 
Summary0015568: strange clrscr and clreol on BeOS
Descriptionrun this program under linux (fpc 2.0.x) and Haiku (fpc 2.4.0).
Output is bad on Haiku.
Please check also clreol (not on example)

uses crt;

TagsNo tags attached.
Fixed in Revision
Attached Files


related to 0019540 resolvedJonas Maebe strange clrscr and clreol on Mac 



2010-02-22 03:39

reporter   ~0034662

Could you describe the expected behavior ? I don't have a Linux box right now to compare myself.

Salvatore Licciardi

2010-02-23 12:22

reporter   ~0034694

output of clrscr and clreol are identical on dos/windows/os2/linux.

Download this
and run the BeOs version.
I fix problem with my file "". Remove this file,
Recompile EDIT350.pas (you need to fix "altro32.pas")

Run again the program, then output is wrong. Press F10 , go to menu "opzioni" , "infomazioni ..."
again stange output


2010-03-04 01:24

reporter   ~0034926

I am not able to run the beos version under Haiku or BeOS Bone (Troubles handling dynamic section under Haiku "cannot execute binary file" under BeOS).

Recompiling the program give me this output :

~/Desktop/EDiTury350/sources> ppc386 EDIT350.PAS
Free Pascal Compiler version 2.5.1 [2010/03/01] for i386
Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Haiku for i386
Compiling EDIT350.PAS
Compiling Type_var.pas
Compiling MCLICK22.PAS
Compiling ALTRO32.PAS
ALTRO32.PAS(1008,24) Warning: unreachable code
ALTRO32.PAS(1317,20) Warning: unreachable code
ALTRO32.PAS(4919,20) Error: Typed files cannot contain reference-counted types.
ALTRO32.PAS(7217,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted

Maybe an option is missing on my command line. But i can't figure which one.

A short description like "background use <this> color while it should use <another> one" would be helpfull once i will be able to compile the editor. At least to ensure i look at the right problem. I am almost a newbie in advanced console application development.


2010-06-06 19:38

reporter   ~0038347

Last edited: 2010-06-06 23:53

I was finally able to compile the editor and understand the problem.

Haiku's Terminal does not use the current background color to paint the cleaned area. Instead, the default background color is used (white by default). The two affected escape sequences are :
 - [K used in ClrEol,
 - [*J used in ClrScr.

It is possible to workaround the problem in freepascal by ignoring those escape sequences (see attached patch). But i do not think this patch should be applied in the source tree.
The problem should be fixed in the first place, aka in the Haiku source tree. I will create a bug report for that.

2010-06-06 19:39


crt.pp.diff (698 bytes)   
Index: crt.pp
--- crt.pp	(revision 15382)
+++ crt.pp	(working copy)
@@ -452,8 +452,12 @@
   Full Screen 80x25? Window(1,1,80,25) is used, allows faster routines
+  {$ifdef HAIKU}
+  FullWin := False;
+  {$else}
   FullWin:=(WindMinX=1) and (WindMinY=1) and
            (WindMaxX=ScreenWidth) and (WindMaxY=ScreenHeight);
+  {$endif}
@@ -669,7 +673,11 @@
+{$ifdef haiku}
+  if FullWin {or (WindMaxX = ScreenWidth)} then
   if FullWin or (WindMaxX = ScreenWidth) then
      if not OutputRedir then
crt.pp.diff (698 bytes)   


2010-09-12 23:42

reporter   ~0041010

Just for reference, here is the bug report in Haiku's bugtracker :

The problem is not yet entirely solved. I will update this ticket once it is done.


2013-05-31 23:27

reporter   ~0067967

This problem is fixed under Haiku starting with revision hrev45364 (

Issue History

Date Modified Username Field Change
2010-01-23 11:05 Salvatore Licciardi New Issue
2010-01-23 12:09 Jonas Maebe Status new => assigned
2010-01-23 12:09 Jonas Maebe Assigned To => olivier
2010-02-13 16:38 Marco van de Voort FPCOldBugId => 0
2010-02-13 16:38 Marco van de Voort Summary strange clrscr and clreol => strange clrscr and clreol on BeOS
2010-02-22 03:39 olivier Note Added: 0034662
2010-02-23 12:22 Salvatore Licciardi Note Added: 0034694
2010-03-04 01:24 olivier Note Added: 0034926
2010-03-04 12:26 Marco van de Voort Status assigned => feedback
2010-06-06 19:38 olivier Note Added: 0038347
2010-06-06 19:39 olivier File Added: crt.pp.diff
2010-06-06 23:53 olivier Note Edited: 0038347
2010-09-12 23:42 olivier Note Added: 0041010
2011-06-10 21:13 Jonas Maebe Relationship added related to 0019540
2013-05-31 23:27 olivier Note Added: 0067967