Recent

Author Topic: [SOLVED] Disadvantages of the Lazarus Terminal Output Window (Linux)  (Read 874 times)

Hartmut

  • Full Member
  • ***
  • Posts: 220
I'm adapting a couple of console programs from Windows to Linux. For to test the program output I wanted to use the Terminal Output Window, which you can find in Lazarus menu View / Debug Windows / Terminal Output. But this console window has several disadvantages:
 - there are always some ugly special chars at program start
 - gotoxy() does not work
 - clrscr() does not work
 - colors via 'TextAttr' do not work
 - lines are broken after 80 chars although the window can hold much more
 - the font has not an equal width for each char (important for columns of tables)
 - when you start the program, this window doesn't come to front

Here is a demo program and attached a screenshot of its output:

Code: Pascal  [Select]
  1. uses crt;
  2.  
  3. begin
  4. writeln('Hello world');
  5. gotoxy(20,20); writeln('This should be position (20,20)');
  6. clrscr; writeln('Screen cleared');
  7. TextAttr:=Red; writeln('This is red color');
  8. writeln('This is a longer text of 89 characters, but the line is broken to a new line without need');
  9. writeln('mmmmmmmmmm (10 chars)');
  10. writeln('iiiiiiiiii (10 chars)');
  11. end.

Is it possible to avoid this disadvantages?
I'm an absolute beginner on Linux. How do others test their console programs out of Lazarus on Linux?
I'm using Lazarus 1.8.4 on Ubuntu 18.04 with KDE-Plasma desktop.
Thanks in advance.
« Last Edit: October 04, 2018, 06:08:15 pm by Hartmut »

Thaddy

  • Hero Member
  • *****
  • Posts: 7178
Re: Disadvantages of the Lazarus Terminal Output Window (Linux)
« Reply #1 on: October 03, 2018, 04:18:04 pm »
I simply do not use the Lazarus terminal window, but an actual terminal window.

The lazarus terminal output is not a full terminal/console on all platforms. (actually it is utterly useless for terminal programs, but handy for GUI programs and debug output)
inline variables like in D10.3 are a bit like Brexit: if you are given the wrong information it sounds like a good idea. Every kid loves candy, but it makes you fat and your teeth will disappear.

Handoko

  • Hero Member
  • *****
  • Posts: 2678
  • My goal: build my own game engine using Lazarus
Re: Disadvantages of the Lazarus Terminal Output Window (Linux)
« Reply #2 on: October 03, 2018, 04:19:28 pm »
Yes, the console output has many disadvantages.

I usually use Linux Terminal (Ctrl + Alt + T) for testing Lazarus console programs. And I can easily repeat last command by pressing ArrowUp then Enter.

Blaazen

  • Hero Member
  • *****
  • Posts: 2676
  • POKE 54296,15
    • Eye-Candy Controls
Re: Disadvantages of the Lazarus Terminal Output Window (Linux)
« Reply #3 on: October 03, 2018, 04:36:02 pm »
Note that Ctrl+Alt+T is default Lazarus shortcut for debug window "Threads" but is overridden by global Linux shortcut for terminal (Konsole in KDE, or other).
Lazarus 2.1.0 r59757M FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Hartmut

  • Full Member
  • ***
  • Posts: 220
Re: Disadvantages of the Lazarus Terminal Output Window (Linux)
« Reply #4 on: October 04, 2018, 06:07:53 pm »
I learned that the disadvantages of the Lazarus Terminal Output Window must be taken and that others use instead a separate real Terminal for testing their programs. Thanks a lot for your answers.