Lazarus

Programming => Operating Systems => Linux => Topic started by: Hartmut on October 03, 2018, 03:48:49 pm

Title: [SOLVED] Disadvantages of the Lazarus Terminal Output Window (Linux)
Post by: Hartmut on October 03, 2018, 03:48:49 pm
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.
Title: Re: Disadvantages of the Lazarus Terminal Output Window (Linux)
Post by: Thaddy 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)
Title: Re: Disadvantages of the Lazarus Terminal Output Window (Linux)
Post by: Handoko 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.
Title: Re: Disadvantages of the Lazarus Terminal Output Window (Linux)
Post by: Blaazen 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).
Title: Re: Disadvantages of the Lazarus Terminal Output Window (Linux)
Post by: Hartmut 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.