Hello all, I will try describe my problem in short:
{<program name=hello.pas>}
program hello; uses crt; begin clrscr; writeln; writeln; writeln("Hello Dolly"); end.
{</program>}
Then will I compile this code with: gpc -o hello.e --automake hello.pas
!!!Main problem!!!: When running $ ./hello.e under xterm in X Windows, it just blinks and NOTHING is written into screen.
$ ./hello.e > err.log 2>&1 produces me this:
^[(B^[)0^[[?1049h^[[1;24r^[[m^O^[[4l^[[?7h^[[39;49m^[[?1h^[=^[[39;49m^[[37m^[[40m^[[37m^[[40m^[[H^[[2J^[[m^O^[[39;49m^[[37m^[[40m^[[?1h^[=^[[?25h^[[39;49m^[[37m^[[40m^[[37m^[[40m^[[H^[[2J
Hello Dolly^M ^[[m^O^[[39;49m^[[37m^[[40m^[[39;49m^[[24d^[[K^[[24;1H^[[?1049l^M^[[?1l^[>
It behaves just fine and as expected when I change TERM variable from xterm to linux or vt100. But it is not solution, for me. ;-(
System is: Debian Woody (stable) running on sparc64 (Sun Ultra 1) Relevant packages: stable libncurses5 5.2.20020112a-7 stable libncurses5-dev 5.2.20020112a-7 stable ncurses-bin 5.2.20020112a-7 stable ncurses-base 5.2.20020112a-7 stable ncurses-term 5.2.20020112a-7 stable gpc-2.95 1:2.95.4-7
Any help, tips will be very appreciated. Thanks.
mARTin
Martin Rusko wrote:
When running $ ./hello.e under xterm in X Windows, it just blinks and NOTHING is written into screen.
Quoting a mail from Emil Jerabek of 31 Jan 2002:
: That's not a bug, that's a feature :-) : Konsole restores automatically the previous screen contents after the curses shut down : (-> your example doesn't leave a visible trace).
(This applies to most kinds of X terminals.)
I could try to avoid this feature (optionally) in the CRT unit, if there's interest (last time the issue was discussed, there was not much of a reaction, so I assumed noone really cared).
Frank
Thank you for your reply. I know about Emil's mail, and I know that restoring screen is expected behaviour of curses (CRT) library. But I don't think, that my example doesn't leave a visible trace. I will include my code example here again.
program hello; uses crt; begin clrscr; writeln; writeln; writeln("Hello Dolly"); <- I'm writing Hello Doly here, it is end. a visible trace, isn't it?
I also did some additional tests and found, that it is working in xterm, when that xterm is running remotely from my Sun Ultra on x86 machine running Mandrake. Maybe it is a Debian specific problem. Also I'm a little bit confused about fidling with TERM variable, as I wrote in my previous post.
Any ideas now?
Thanks
mARTin
Frank Heckenbach wrote:
Martin Rusko wrote:
When running $ ./hello.e under xterm in X Windows, it just blinks and NOTHING is written into screen.
Quoting a mail from Emil Jerabek of 31 Jan 2002:
: That's not a bug, that's a feature :-) : Konsole restores automatically the previous screen contents after the curses shut down : (-> your example doesn't leave a visible trace).
(This applies to most kinds of X terminals.)
I could try to avoid this feature (optionally) in the CRT unit, if there's interest (last time the issue was discussed, there was not much of a reaction, so I assumed noone really cared).
Frank
On 24 Sep 2002 at 11:30, Martin Rusko wrote:
Thank you for your reply. I know about Emil's mail, and I know that restoring screen is expected behaviour of curses (CRT) library. But I don't think, that my example doesn't leave a visible trace. I will include my code example here again.
program hello; uses crt; begin clrscr; writeln; writeln; writeln("Hello Dolly"); <- I'm writing Hello Doly here, it is end. a visible trace, isn't it?
Insert a "Readln;" after the "writeln ('Hello Dolly');" and then you will see what he means.
Best regards, The Chief --------- Prof. Abimbola Olowofoyeku (The African Chief) Email: African_Chief@bigfoot.com http://www.bigfoot.com/~african_chief/
Martin Rusko wrote:
Thank you for your reply. I know about Emil's mail, and I know that restoring screen is expected behaviour of curses (CRT) library. But I don't think, that my example doesn't leave a visible trace. I will include my code example here again.
What he meant is that the compiled program does not leave a visible trace (or only a flash, depending on some circumstances), while your source code *should* do so.
So the text is written and immediately overwritten again when the old screen contents are restored. (And the write might even be optimized away because of the overwriting.)
I also did some additional tests and found, that it is working in xterm, when that xterm is running remotely from my Sun Ultra on x86 machine running Mandrake. Maybe it is a Debian specific problem. Also I'm a little bit confused about fidling with TERM variable, as I wrote in my previous post.
Apparently your TERM setting seems to work well (maybe *too* well ;-).
Quoting a mail from Emil Jerabek of 31 Jan 2002:
: That's not a bug, that's a feature :-) : Konsole restores automatically the previous screen contents after the curses shut down : (-> your example doesn't leave a visible trace).
(This applies to most kinds of X terminals.)
I could try to avoid this feature (optionally) in the CRT unit, if there's interest (last time the issue was discussed, there was not much of a reaction, so I assumed noone really cared).
Frank
Well, I understand now... ;-) Thank you all for your time.
Best regards
mARTin
Frank Heckenbach wrote:
Martin Rusko wrote:
Thank you for your reply. I know about Emil's mail, and I know that restoring screen is expected behaviour of curses (CRT) library. But I don't think, that my example doesn't leave a visible trace. I will include my code example here again.
What he meant is that the compiled program does not leave a visible trace (or only a flash, depending on some circumstances), while your source code *should* do so.
So the text is written and immediately overwritten again when the old screen contents are restored. (And the write might even be optimized away because of the overwriting.)
I also did some additional tests and found, that it is working in xterm, when that xterm is running remotely from my Sun Ultra on x86 machine running Mandrake. Maybe it is a Debian specific problem. Also I'm a little bit confused about fidling with TERM variable, as I wrote in my previous post.
Apparently your TERM setting seems to work well (maybe *too* well ;-).
Quoting a mail from Emil Jerabek of 31 Jan 2002:
: That's not a bug, that's a feature :-) : Konsole restores automatically the previous screen contents after the curses shut down : (-> your example doesn't leave a visible trace).
(This applies to most kinds of X terminals.)
I could try to avoid this feature (optionally) in the CRT unit, if there's interest (last time the issue was discussed, there was not much of a reaction, so I assumed noone really cared).
Frank
I wrote:
Martin Rusko wrote:
When running $ ./hello.e under xterm in X Windows, it just blinks and NOTHING is written into screen.
Quoting a mail from Emil Jerabek of 31 Jan 2002:
: That's not a bug, that's a feature :-) : Konsole restores automatically the previous screen contents after the curses shut down : (-> your example doesn't leave a visible trace).
(This applies to most kinds of X terminals.)
I could try to avoid this feature (optionally) in the CRT unit, if there's interest (last time the issue was discussed, there was not much of a reaction, so I assumed noone really cared).
I'm now adding this possibility. With the next GPC release (probably next week), you can do `CRTSavePreviousScreen (False)' (at the start of the program, before anything of CRT is used) to avoid the saving and restoring of xterm contents.
Frank