[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] TosWin2 "Open console...at output"



Hello.

By looking at tools/toswin2/console.c, I finally understood the meaning of that mysterious "Open console...at output" option. Basically, it means: if the console windows is _iconified_ when some output occurs, restore it automatically. But the Console window will never automatically open if it is _closed_.

First, don't confuse "Console" and "Shell".

A Shell is a textmode window where some process is running, i.e. bash. Also, when a .tos or .ttp program is double-clicked from the desktop, TosWin2 automatically opens a new Shell to run it inside.

The Console is a special window where the text output from .prg goes. Theoretically, this should not happen, because if a program uses text output, it should be renamed .tos or .ttp. Exceptions are programs like Qextract: graphical front-ends (.prg) for command-line tools (.ttp) which produce text output.

With a multitasking environment such as FreeMiNT+XaAES, sending text to the console is not a good thing. Even with FreeMiNT, the default console is handled by the BIOS in full screen. With standard hardware, the VDI and the BIOS console share the same screen memory. When both are used at the same time, this produces screen corruption (text printed over graphics, etc.). With special VDI drivers (ARAnyM+fVDI, maybe some graphics cards...), the BIOS console output is not displayed at all. This is why TosWin2 has the Console window. Combined to xconout2.xdd support, it allows to redirect the text sent to the BIOS console into the Console window. This is cleaner, and works with any graphics card.

Here is how things works.

1) First, the Console window has to be manually opened (or opened at startup). If the Console window is closed, text output from .prg will still go to the BIOS console. Regardless of the "Open console...at output" setting.

2) If the Console window is opened or minimized, the text output will go to it, as expected.

3) If the "Open console...at output" option is checked, any text output restore the Console window from iconified to normal state. This never happens if the Console window is closed.

That being said, I think that it would be better if the TosWin2 console would work as we naively expect: initially closed, but automatically opened when some text output occurs. This way, we would never see any screen corruption.

NB: There is still a "stair problem" (missing CR) in both the BIOS and TosWin2 console. I'm going to investigate that bug in a different thread.

--
Vincent Rivière