<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.c256foenix.com/index.php?action=history&amp;feed=atom&amp;title=ANSI_Support</id>
	<title>ANSI Support - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.c256foenix.com/index.php?action=history&amp;feed=atom&amp;title=ANSI_Support"/>
	<link rel="alternate" type="text/html" href="https://wiki.c256foenix.com/index.php?title=ANSI_Support&amp;action=history"/>
	<updated>2026-07-02T12:10:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>https://wiki.c256foenix.com/index.php?title=ANSI_Support&amp;diff=581&amp;oldid=prev</id>
		<title>PJW: /* ANSI Escape Codes */</title>
		<link rel="alternate" type="text/html" href="https://wiki.c256foenix.com/index.php?title=ANSI_Support&amp;diff=581&amp;oldid=prev"/>
		<updated>2021-06-01T04:37:04Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;ANSI Escape Codes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 04:37, 1 June 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot; &gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| CSI ''n'' P || DCH || Deletes ''n'' (default: 1) characters starting at the cursor.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| CSI ''n'' P || DCH || Deletes ''n'' (default: 1) characters starting at the cursor.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| CSI ''n'' h || SM || Sets &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;enables and disables &lt;/del&gt;modes (see table below).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| CSI ''n'' h || SM || Sets &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;terminal &lt;/ins&gt;modes (see table below).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| CSI ''n'' l || RM || Resets &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;enables and disables &lt;/del&gt;modes (see table below).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| CSI ''n'' l || RM || Resets &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;terminal &lt;/ins&gt;modes (see table below).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| CSI ''n'' m || SGR || Sets the appearance of the characters to be printed next (see table below).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| CSI ''n'' m || SGR || Sets the appearance of the characters to be printed next (see table below).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PJW</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.c256foenix.com/index.php?title=ANSI_Support&amp;diff=574&amp;oldid=prev</id>
		<title>PJW: Created page with &quot;As of v0.4 of the kernel, the PUTC function now supports printing to the EVID expansion card and ANSI style control sequences.  = Printing to the EVID Screen =  If the EVID ca...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.c256foenix.com/index.php?title=ANSI_Support&amp;diff=574&amp;oldid=prev"/>
		<updated>2021-06-01T00:44:22Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;As of v0.4 of the kernel, the PUTC function now supports printing to the EVID expansion card and ANSI style control sequences.  = Printing to the EVID Screen =  If the EVID ca...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;As of v0.4 of the kernel, the PUTC function now supports printing to the EVID expansion card and ANSI style control sequences.&lt;br /&gt;
&lt;br /&gt;
= Printing to the EVID Screen =&lt;br /&gt;
&lt;br /&gt;
If the EVID card is installed, the EVID screen is available on channel #4.&lt;br /&gt;
To print text to the EVID screen, use the SETOUT kernel routine to set the channel to 4&lt;br /&gt;
and then call PUTC or any routine that uses PUTC to print. The characters will be printed&lt;br /&gt;
to the EVID screen. To go back to printing to the main screen, use SETOUT to set the channel to 0.&lt;br /&gt;
&lt;br /&gt;
Note that the EVID screen and the main screen are completely independent. They can be used at different&lt;br /&gt;
resolutions and with different border sizes. Also they have independent cursors and terminal state (e.g. current printing color).&lt;br /&gt;
&lt;br /&gt;
= ANSI Escape Codes =&lt;br /&gt;
&lt;br /&gt;
PUTC will do some elementary interpretation of ANSI or VT style escape codes to control the screen. The codes can be used with&lt;br /&gt;
either screen. The following escape sequences are supported:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Escape !! Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' @ || ICH || Inserts ''n'' (default: 1) blank characters, starting at the cursor.&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' A || CUU || Move the cursor up ''n'' (default: 1) rows.&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' B || CUD || Move the cursor down ''n'' (default: 1) rows.&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' C || CUF || Move the cursor forward ''n'' (default: 1) positions.&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' D || CUB || Move the cursor back ''n'' (default: 1) positions.&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'';''m'' H || CUP || Move the cursor to position (n, m) on the screen... home position of (1, 1) if no parameters provided.&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' J || ED || Erase part or all of the screen, based on ''n''. If ''n'' is 0 or missing, clear from the cursor to the end of the screen. If ''n'' is 1, erase from the beginning of the screen to the cursor. If ''n'' is 2, erase the entire screen.&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' K || EL || Erase part or all of the current line, based on ''n''. If ''n'' is 0 or missing, clear from the cursor to the end of the line. If ''n'' is 1, erase from the beginning of the line to the cursor. If ''n'' is 2, erase the entire line.&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' P || DCH || Deletes ''n'' (default: 1) characters starting at the cursor.&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' h || SM || Sets enables and disables modes (see table below).&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' l || RM || Resets enables and disables modes (see table below).&lt;br /&gt;
|-&lt;br /&gt;
| CSI ''n'' m || SGR || Sets the appearance of the characters to be printed next (see table below).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SGR Support ==&lt;br /&gt;
&lt;br /&gt;
The support for the standard SGR codes is somewhat limited in the Foenix kernel, due to limitations in the text mode screen. Here are the codes the kernel supports:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Code !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Set the foreground to high intensity&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Go back to normal intensity &lt;br /&gt;
|-&lt;br /&gt;
| 7 || Enable reversed text&lt;br /&gt;
|-&lt;br /&gt;
| 22 || Go back to normal intensity &lt;br /&gt;
|-&lt;br /&gt;
| 27 || Stop inverting the colors&lt;br /&gt;
|-&lt;br /&gt;
| 30..37 || Set the foreground color&lt;br /&gt;
|-&lt;br /&gt;
| 39 || Restore the default foreground color&lt;br /&gt;
|-&lt;br /&gt;
| 40..47 || Set the background color&lt;br /&gt;
|-&lt;br /&gt;
| 49 || Restore the default background color&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Mode Support ==&lt;br /&gt;
&lt;br /&gt;
There are only two modes that can be set or reset:&lt;br /&gt;
* 25 will show (set) or hide (reset) the cursor.&lt;br /&gt;
* 28 will enable (set) or disable (reset) the processing of the PAUSE/BREAK key.&lt;br /&gt;
If processing is disabled, the TESTBREAK kernel routine will not return if the&lt;br /&gt;
PAUSE/BREAK key has been pressed. The key will be ignored until re-enabled.&lt;/div&gt;</summary>
		<author><name>PJW</name></author>
		
	</entry>
</feed>