Zeal-Operating-System / ZealOS

The Zeal Operating System is a modernized fork of the 64-bit Temple Operating System, TempleOS.
https://zealos.net
The Unlicense
1.43k stars 67 forks source link

Dollar sign causes EOF? #4

Closed ghost closed 2 years ago

ghost commented 2 years ago

image If there is a single dollar sign in a file, Ed() seems to just cut the file. I don't knowif this is expected behavior. image

image If I put two dollar signs, then the machine shows it as one dollar sign. image

TomAwezome commented 2 years ago

A single dollar sign, in DolDoc syntax, is an escape character, recognized as the beginning of a DolDoc tag. An example is $GREEN$, which is a DolDoc tag that sets the current foreground text color to green. If you type a dollar sign in a document, type another one to make it a double-dollar-sign, which DolDoc recognizes and prints as a standard character, instead of as DolDoc syntax. DolDoc tags won't be visible when viewing a document because they affect how the document is drawn, they aren't drawn characters. To see the tags in a document, press Ctrl-T. https://zeal-operating-system.github.io/ZealOS/Doc/DolDocOverview.DD.html https://zeal-operating-system.github.io/ZealOS/Doc/CosmiC.DD.html#l240 If importing files that contain dollar signs, you can try opening them with the Plain function first, to view them as plain-text.

ghost commented 2 years ago

Oh, I get it. Thanks for the answer!

ghost commented 2 years ago

Can I ask another question? How do you use escape codes in TempleOS? Print("\x1b[2J"); doesn't seem to work..

TomAwezome commented 2 years ago

ANSI escape codes are not supported.

ghost commented 2 years ago

Then is there a command like clear?

TomAwezome commented 2 years ago

Yes, $CL$ is a DolDoc tag that will clear the entire document, and the functions Cls and DocClear can be used to clear the window programmatically as well.

TomAwezome commented 2 years ago

As a note, you don't have to use Print() to print strings. Using raw quotes as a statement, such as "Test:\n"; will print to the document. Also, there is a function ToDolDoc which can be used to duplicate dollar signs in a document to make it functional as DolDoc.