2010-11-08 15:31:01 +10:00
|
|
|
|
|
|
|
ANSICON
|
|
|
|
|
2017-10-27 21:28:52 +10:00
|
|
|
Copyright 2005-2017 Jason Hood
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2018-02-12 16:44:55 +10:00
|
|
|
Version 1.82-wip. Freeware
|
2010-11-08 15:31:01 +10:00
|
|
|
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Description
|
|
|
|
===========
|
2010-11-08 15:31:01 +10:00
|
|
|
|
|
|
|
ANSICON provides ANSI escape sequences for Windows console programs. It
|
2013-07-19 00:14:54 +10:00
|
|
|
provides much the same functionality as 'ANSI.SYS' does for MS-DOS.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Requirements
|
|
|
|
============
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2012-11-24 23:41:29 +10:00
|
|
|
32-bit: Windows 2000 Professional and later (it won't work with NT or 9X).
|
2014-02-05 00:21:42 +10:00
|
|
|
64-bit: AMD64 (IA64 could work with a little modification).
|
2010-11-08 15:31:01 +10:00
|
|
|
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Installation
|
|
|
|
============
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2017-12-23 22:04:44 +10:00
|
|
|
There are three ways to install, depending on your usage.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2017-12-23 22:04:44 +10:00
|
|
|
* Add "x86" (if your OS is 32-bit) or "x64" (if 64-bit) to your PATH, or
|
|
|
|
copy the relevant files to a directory already on the PATH (but NOT to
|
|
|
|
"System32" on a 64-bit system). This means you explicitly run 'ansicon'
|
|
|
|
whenever you want to use it.
|
2013-07-19 00:14:54 +10:00
|
|
|
|
2017-12-23 22:04:44 +10:00
|
|
|
* Use option '-i' (or '-I', if permitted) to add an entry to CMD.EXE's
|
|
|
|
AutoRun registry value (current user or local machine, respectively).
|
|
|
|
This means "Command Prompt" and any program started by CMD.EXE will
|
|
|
|
automatically have sequences.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2017-12-23 22:04:44 +10:00
|
|
|
* Add "d:\path\to\ansicon.exe -p" to your Startup group (run minimized to
|
|
|
|
avoid the console window flashing). This means any console program
|
|
|
|
started by Explorer will automatically have sequences.
|
|
|
|
|
|
|
|
Uninstall involves closing any programs that are currently using it; using
|
|
|
|
the Run dialog to run "d:\path\to\ansicon.exe -pu" to remove it from
|
|
|
|
Explorer; running with '-u' (and/or '-U') to remove it from AutoRun; remov-
|
|
|
|
ing the directory from PATH; and deleting the files. No other changes are
|
|
|
|
made (unless you created environment variables).
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2017-12-24 10:11:57 +10:00
|
|
|
Upgrading
|
|
|
|
---------
|
|
|
|
|
|
|
|
Delete ANSICON_API - it has switched from WriteFile to WriteConsoleA.
|
|
|
|
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Usage
|
|
|
|
=====
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2011-03-01 21:01:37 +10:00
|
|
|
Options (case sensitive):
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
-l Log to "%TEMP%\ansicon.log".
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
-p Enable the parent process (i.e. the command shell used to run
|
|
|
|
ANSICON) to recognise escapes.
|
2011-03-01 21:01:37 +10:00
|
|
|
|
2017-11-30 21:05:41 +10:00
|
|
|
-pu Unload from the parent process, restoring it.
|
|
|
|
|
2011-03-01 21:01:37 +10:00
|
|
|
-m Set the current (and default) attribute to grey on black
|
2013-07-19 00:14:54 +10:00
|
|
|
("monochrome"), or the attribute following the 'm' (please
|
|
|
|
use 'COLOR /?' for attribute values).
|
2011-03-01 21:01:37 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
-e Echo the command line - a space or tab after the 'e' is
|
2011-03-01 21:01:37 +10:00
|
|
|
ignored, the remainder is displayed verbatim.
|
|
|
|
|
|
|
|
-E As above, but no newline is added.
|
|
|
|
|
|
|
|
-t Display ("type") each file (or standard input if none or the
|
|
|
|
name is "-") as though they are a single file.
|
|
|
|
|
|
|
|
-T Display "==> FILE NAME <==", a blank line (or an error
|
|
|
|
message), the file and another blank line.
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Running ANSICON with no arguments will start a new instance of the command
|
|
|
|
processor (the program defined by the 'ComSpec' environment variable, typ-
|
|
|
|
ically 'CMD.EXE'), or display standard input if it is redirected. Any arg-
|
|
|
|
ument will be treated as a program and its arguments.
|
2011-03-01 21:01:37 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
E.g.: 'ansicon -m30 -t file.ans' will display "file.ans" using black on
|
2011-03-01 21:01:37 +10:00
|
|
|
cyan as the default color.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
The attribute may start with '-' to permanently reverse the foreground and
|
|
|
|
background colors (but not when using '-p'). E.g.: 'ansicon -m-f0 -t
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
file.log' will use reversed black on white as the default (i.e. white on
|
|
|
|
black, with foreground sequences changing the background).
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
If you experience trouble with certain programs, the log may help in find-
|
|
|
|
ing the cause; it can be found at "%TEMP%\ansicon.log". A number should
|
2017-12-23 22:04:44 +10:00
|
|
|
immediately follow the 'l':
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
|
|
|
|
0 No logging
|
|
|
|
1 Log process start and end
|
|
|
|
2 Above, plus log modules used by the process
|
|
|
|
3 Above, plus log functions that are hooked
|
|
|
|
4 Log console output (add to any of the above)
|
|
|
|
8 Append to the existing file (add to any of the above)
|
2012-02-24 12:53:07 +10:00
|
|
|
16 Log all imported modules (add to any of the above)
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
The log option will not work with '-p'; set the environment variable
|
2014-02-05 00:21:42 +10:00
|
|
|
ANSICON_LOG (to the number) instead. The variable is only read once when a
|
|
|
|
process is started; changing it won't affect running processes. If you
|
2014-02-18 21:34:39 +10:00
|
|
|
identify a program or module that causes problems, add it to the
|
|
|
|
ANSICON_EXC environment variable (see ANSICON_API below; add the extension
|
|
|
|
to exclude a single module). Be aware that excluding a program will also
|
|
|
|
exclude any programs it creates (alghough excluding "program.exe" may still
|
|
|
|
hook created programs run through its DLLs).
|
2013-07-19 00:14:54 +10:00
|
|
|
|
|
|
|
E.g.: 'ansicon -l5' will start a new command processor, logging every pro-
|
|
|
|
cess it starts along with their output.
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
|
2010-11-08 15:31:01 +10:00
|
|
|
Once installed, the ANSICON environment variable will be created. This
|
2013-07-19 00:14:54 +10:00
|
|
|
variable is of the form "WxH (wxh)", where 'W' & 'H' are the width and
|
|
|
|
height of the buffer and 'w' & 'h' are the width and height of the window.
|
|
|
|
The variable is updated whenever a program reads it directly (i.e. as an
|
|
|
|
individual request, not as part of the entire environment block). For
|
|
|
|
example, 'set an' will not update it, but 'echo %ansicon%' will. Also
|
2017-12-23 22:04:44 +10:00
|
|
|
created are ANSICON_VER, which contains the version without the point (1.80
|
|
|
|
becomes "180"), and CLICOLOR (see http://bixense.com/clicolors/), which
|
2017-07-25 18:18:34 +10:00
|
|
|
contains "1". These variables do not exist as part of the environment
|
|
|
|
block (e.g. 'set an' will not show ANSICON_VER).
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
|
|
|
|
If installed, GUI programs will not be hooked. Either start the program
|
2013-07-19 00:14:54 +10:00
|
|
|
directly with 'ansicon', or add it to the ANSICON_GUI variable (see
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
ANSICON_API below).
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Using 'ansicon' after install will always start with the default attrib-
|
|
|
|
utes, restoring the originals on exit; all other programs will use the cur-
|
2017-12-23 22:04:44 +10:00
|
|
|
rent attributes. The shift state and insert mode are always reset for a
|
|
|
|
new process.
|
2013-07-19 00:14:54 +10:00
|
|
|
|
2018-02-12 16:44:55 +10:00
|
|
|
ANSICON will detect when a line wraps at the right margin and suppress a
|
|
|
|
following newline. Some programs detect the wrap themselves and so the
|
|
|
|
following newline is actually for a blank line; use the ANSICON_WRAP
|
|
|
|
variable to indicate as such (see ANSICON_API below).
|
|
|
|
|
2017-07-25 18:18:34 +10:00
|
|
|
My version of WriteConsoleA will always set the number of characters writt-
|
|
|
|
en, not the number of bytes. This means writing a double-byte character as
|
|
|
|
two bytes will set 0 the first write (nothing was written) and 1 the second
|
|
|
|
(when the character was actually written); Windows normally sets 1 for both
|
|
|
|
writes. Similarly, writing the individual bytes of a multibyte character
|
|
|
|
will set 0 for all but the last byte, then 1 on the last; Windows normally
|
|
|
|
sets 1 for each byte, writing the undefined character. However, my
|
|
|
|
WriteFile (and _lwrite/_hwrite) will always set what was received; Windows,
|
|
|
|
using a multibyte character set (but not DBCS), would set the characters.
|
|
|
|
You can have WriteConsoleA return the original byte count by using the
|
|
|
|
ANSICON_API environment variable:
|
2010-11-19 15:50:10 +10:00
|
|
|
|
|
|
|
ANSICON_API=[!]program;program;program...
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
PROGRAM is the name of the program, with no path and extension. The lead-
|
|
|
|
ing exclamation inverts the usage, meaning the API will always be over-
|
|
|
|
ridden, unless the program is in the list. The variable can be made perm-
|
|
|
|
anent by going to System Properties, selecting the Advanced tab (with Vista
|
|
|
|
onwards, this can be done by running "SystemPropertiesAdvanced") and click-
|
|
|
|
ing Environment Variables.
|
2010-11-19 15:50:10 +10:00
|
|
|
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Sequences Recognised
|
|
|
|
====================
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2017-12-10 22:52:38 +10:00
|
|
|
The following escape sequences are recognised (see "sequences.txt" for a
|
|
|
|
more complete description).
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2014-02-20 18:06:28 +10:00
|
|
|
\e]0;titleBEL xterm: Set window's title (and icon, ignored)
|
|
|
|
\e]2;titleBEL xterm: Set window's title
|
2017-11-29 11:06:57 +10:00
|
|
|
\e]4;...BEL xterm: Change color(s)
|
|
|
|
\e]104;...BEL xterm: Reset color(s)
|
2014-02-20 18:06:28 +10:00
|
|
|
\e[21t xterm: Report window's title
|
|
|
|
\e[s ANSI.SYS: Save Cursor Position
|
|
|
|
\e[u ANSI.SYS: Restore Cursor Position
|
2017-12-22 18:08:51 +10:00
|
|
|
\e[1+h ACFM Flush Mode (flush immediately)
|
|
|
|
\e[1+l ACFM Flush Mode (flush when necessary)
|
2017-11-30 11:38:15 +10:00
|
|
|
BEL BEL Bell
|
Recognise more sequences; ignore newline immediately after wrap.
Added support for CHT & CBT (move forward/backward by tabs), DECAWM (don't
wrap at EOL), CRM (display control characters, but still perform newline)
and REP (repeat last character, including BEL, BS, TAB, LF and CR).
It always bugged me that newline would add an unneeded blank line due to
wrap, but not enough to do anything about it. For some reason, adding CRM
got me to thinking about it, so I finally did it.
Stopped \e[K from erasing the first character of the next line.
Restore cursor visibility on unload.
2014-02-26 21:18:45 +10:00
|
|
|
\e[#Z CBT Cursor Backward Tabulation
|
2012-06-02 17:20:21 +10:00
|
|
|
\e[#G CHA Cursor Character Absolute
|
Recognise more sequences; ignore newline immediately after wrap.
Added support for CHT & CBT (move forward/backward by tabs), DECAWM (don't
wrap at EOL), CRM (display control characters, but still perform newline)
and REP (repeat last character, including BEL, BS, TAB, LF and CR).
It always bugged me that newline would add an unneeded blank line due to
wrap, but not enough to do anything about it. For some reason, adding CRM
got me to thinking about it, so I finally did it.
Stopped \e[K from erasing the first character of the next line.
Restore cursor visibility on unload.
2014-02-26 21:18:45 +10:00
|
|
|
\e[#I CHT Cursor Forward Tabulation
|
2011-03-01 21:01:37 +10:00
|
|
|
\e[#E CNL Cursor Next Line
|
|
|
|
\e[#F CPL Cursor Preceding Line
|
Recognise more sequences; ignore newline immediately after wrap.
Added support for CHT & CBT (move forward/backward by tabs), DECAWM (don't
wrap at EOL), CRM (display control characters, but still perform newline)
and REP (repeat last character, including BEL, BS, TAB, LF and CR).
It always bugged me that newline would add an unneeded blank line due to
wrap, but not enough to do anything about it. For some reason, adding CRM
got me to thinking about it, so I finally did it.
Stopped \e[K from erasing the first character of the next line.
Restore cursor visibility on unload.
2014-02-26 21:18:45 +10:00
|
|
|
\e[3h CRM Control Representation Mode (display controls)
|
|
|
|
\e[3l CRM Control Representation Mode (perform controls)
|
2012-06-02 17:20:21 +10:00
|
|
|
\e[#D CUB Cursor Left
|
|
|
|
\e[#B CUD Cursor Down
|
|
|
|
\e[#C CUF Cursor Right
|
|
|
|
\e[#;#H CUP Cursor Position
|
|
|
|
\e[#A CUU Cursor Up
|
2017-12-09 11:11:52 +10:00
|
|
|
\e[c DA Device Attributes
|
2012-06-02 17:20:21 +10:00
|
|
|
\e[#P DCH Delete Character
|
2017-12-11 11:34:32 +10:00
|
|
|
\e[?7h DECAWM Autowrap Mode (autowrap)
|
|
|
|
\e[?7l DECAWM Autowrap Mode (no autowrap)
|
|
|
|
\e[?3h DECCOLM Selecting 80 or 132 Columns per Page (132)
|
|
|
|
\e[?3l DECCOLM Selecting 80 or 132 Columns per Page (prior)
|
2017-12-11 12:04:07 +10:00
|
|
|
\e[?95h DECNCSM No Clearing Screen On Column Change Mode (keep)
|
|
|
|
\e[?95l DECNCSM No Clearing Screen On Column Change Mode (clear)
|
2017-12-21 20:55:47 +10:00
|
|
|
\e[?6h DECOM Origin Mode (top margin)
|
|
|
|
\e[?6l DECOM Origin Mode (top line)
|
2017-12-11 11:34:32 +10:00
|
|
|
\e[#;#;#...,~ DECPS Play Sound
|
|
|
|
\e8 DECRC Restore Cursor
|
|
|
|
\e7 DECSC Save Cursor
|
|
|
|
\e[?5W DECST8C Set Tab at Every 8 Columns
|
|
|
|
\e[?5;#W DECST8C Set Tab at Every # Columns (ANSICON extension)
|
2017-12-21 20:55:47 +10:00
|
|
|
\e[#;#r DECSTBM Set Top and Bottom Margins
|
2017-12-23 16:44:32 +10:00
|
|
|
\e[!p DECSTR Soft Terminal Reset
|
2017-12-11 11:34:32 +10:00
|
|
|
\e[?25h DECTCEM Text Cursor Enable Mode (show cursor)
|
|
|
|
\e[?25l DECTCEM Text Cursor Enable Mode (hide cursor)
|
2012-06-02 17:20:21 +10:00
|
|
|
\e[#M DL Delete Line
|
|
|
|
\e[#n DSR Device Status Report
|
|
|
|
\e[#X ECH Erase Character
|
|
|
|
\e[#J ED Erase In Page
|
|
|
|
\e[#K EL Erase In Line
|
|
|
|
\e[#` HPA Character Position Absolute
|
|
|
|
\e[#j HPB Character Position Backward
|
|
|
|
\e[#a HPR Character Position Forward
|
2017-12-10 22:52:38 +10:00
|
|
|
HT HT Character Tabulation
|
|
|
|
\eH HTS Character Tabulation Set
|
2012-06-02 17:20:21 +10:00
|
|
|
\e[#;#f HVP Character And Line Position
|
|
|
|
\e[#@ ICH Insert Character
|
|
|
|
\e[#L IL Insert Line
|
2017-12-03 12:50:13 +10:00
|
|
|
\eD IND Index
|
2017-12-17 11:13:12 +10:00
|
|
|
\e[4h IRM Insertion Replacement Mode (insert)
|
|
|
|
\e[4l IRM Insertion Replacement Mode (replace)
|
2012-06-02 17:20:21 +10:00
|
|
|
SI LS0 Locking-shift Zero (see below)
|
|
|
|
SO LS1 Locking-shift One
|
2017-12-03 12:50:13 +10:00
|
|
|
\eE NEL Next Line
|
Recognise more sequences; ignore newline immediately after wrap.
Added support for CHT & CBT (move forward/backward by tabs), DECAWM (don't
wrap at EOL), CRM (display control characters, but still perform newline)
and REP (repeat last character, including BEL, BS, TAB, LF and CR).
It always bugged me that newline would add an unneeded blank line due to
wrap, but not enough to do anything about it. For some reason, adding CRM
got me to thinking about it, so I finally did it.
Stopped \e[K from erasing the first character of the next line.
Restore cursor visibility on unload.
2014-02-26 21:18:45 +10:00
|
|
|
\e[#b REP Repeat
|
2017-12-03 12:50:13 +10:00
|
|
|
\eM RI Reverse Index
|
2017-12-23 16:44:32 +10:00
|
|
|
\ec RIS Reset to Initial State
|
2017-12-09 21:01:13 +10:00
|
|
|
\e(0 SCS Select Character Set (DEC special graphics)
|
|
|
|
\e(B SCS Select Character Set (ASCII)
|
2012-06-02 17:20:21 +10:00
|
|
|
\e[#;#;#m SGR Select Graphic Rendition
|
2017-12-21 20:55:47 +10:00
|
|
|
\e[#T SD Scroll Down/Pan Up
|
|
|
|
\e[#S SU Scroll Up/Pan Down
|
2017-12-10 22:52:38 +10:00
|
|
|
\e[#g TBC Tabulation Clear
|
2012-06-02 17:20:21 +10:00
|
|
|
\e[#d VPA Line Position Absolute
|
|
|
|
\e[#k VPB Line Position Backward
|
|
|
|
\e[#e VPR Line Position Forward
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
'\e' represents the escape character (ASCII 27); '#' represents a decimal
|
2017-12-10 22:52:38 +10:00
|
|
|
number (optional, in most cases defaulting to 1); BEL, HT, SO and SI are
|
|
|
|
ASCII 7, 9, 14 and 15.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2017-11-24 11:10:42 +10:00
|
|
|
Escape followed by a control character will display that character, not
|
2017-12-09 21:01:13 +10:00
|
|
|
perform its function; an unrecognised character will preserve the escape.
|
|
|
|
|
|
|
|
SO will select the G1 character set; SI will select the G0 set. The G0
|
2017-12-23 22:04:44 +10:00
|
|
|
character set is set by SCS; the G1 character set is always the DEC Special
|
|
|
|
Graphics Character Set.
|
2017-11-24 11:10:42 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
I make a distinction between '\e[m' and '\e[0;...m'. Both will restore the
|
|
|
|
original foreground/background colors (and so '0' should be the first para-
|
|
|
|
meter); the former will also restore the original bold and underline attri-
|
|
|
|
butes, whilst the latter will explicitly reset them. The environment var-
|
|
|
|
iable ANSICON_DEF can be used to change the default colors (same value as
|
|
|
|
'-m'; setting the variable does not change the current colors).
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2014-02-20 18:06:28 +10:00
|
|
|
The first time a program clears the screen ('\e[2J') will actually scroll
|
|
|
|
in a new window (assuming the buffer is bigger than the window, of course).
|
|
|
|
Subsequent clears will then blank the window. However, if the window has
|
|
|
|
scrolled, or the cursor is on the last line of the buffer, it will again
|
|
|
|
scroll in a new window.
|
|
|
|
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
DEC Special Graphics Character Set
|
|
|
|
==================================
|
2011-03-01 21:01:37 +10:00
|
|
|
|
|
|
|
This is my interpretation of the set, as shown by
|
|
|
|
http://vt100.net/docs/vt220-rm/table2-4.html.
|
|
|
|
|
|
|
|
|
|
|
|
Char Unicode Code Point & Name
|
|
|
|
---- -------------------------
|
2017-12-09 21:01:13 +10:00
|
|
|
_ U+00A0 No-Break Space
|
2011-03-01 21:01:37 +10:00
|
|
|
` U+2666 Black Diamond Suit
|
|
|
|
a U+2592 Medium Shade
|
|
|
|
b U+2409 Symbol For Horizontal Tabulation
|
|
|
|
c U+240C Symbol For Form Feed
|
|
|
|
d U+240D Symbol For Carriage Return
|
|
|
|
e U+240A Symbol For Line Feed
|
|
|
|
f U+00B0 Degree Sign
|
|
|
|
g U+00B1 Plus-Minus Sign
|
|
|
|
h U+2424 Symbol For Newline
|
|
|
|
i U+240B Symbol For Vertical Tabulation
|
|
|
|
j U+2518 Box Drawings Light Up And Left
|
|
|
|
k U+2510 Box Drawings Light Down And Left
|
|
|
|
l U+250C Box Drawings Light Down And Right
|
|
|
|
m U+2514 Box Drawings Light Up And Right
|
|
|
|
n U+253C Box Drawings Light Vertical And Horizontal
|
2017-11-29 11:42:47 +10:00
|
|
|
o U+23BA Horizontal Scan Line-1
|
|
|
|
p U+23BB Horizontal Scan Line-3
|
2011-03-01 21:01:37 +10:00
|
|
|
q U+2500 Box Drawings Light Horizontal (SCAN 5)
|
2017-11-29 11:42:47 +10:00
|
|
|
r U+23BC Horizontal Scan Line-7
|
|
|
|
s U+23BD Horizontal Scan Line-9
|
2011-03-01 21:01:37 +10:00
|
|
|
t U+251C Box Drawings Light Vertical And Right
|
|
|
|
u U+2524 Box Drawings Light Vertical And Left
|
|
|
|
v U+2534 Box Drawings Light Up And Horizontal
|
|
|
|
w U+252C Box Drawings Light Down And Horizontal
|
|
|
|
x U+2502 Box Drawings Light Vertical
|
|
|
|
y U+2264 Less-Than Or Equal To
|
|
|
|
z U+2265 Greater-Than Or Equal To
|
|
|
|
{ U+03C0 Greek Small Letter Pi
|
|
|
|
| U+2260 Not Equal To
|
|
|
|
} U+00A3 Pound Sign
|
|
|
|
~ U+00B7 Middle Dot
|
|
|
|
|
2011-03-03 17:23:45 +10:00
|
|
|
G1.txt is a Unicode file to view the glyphs "externally". G1.bat is a
|
2013-07-19 00:14:54 +10:00
|
|
|
batch file (using 'x86\ansicon') to show the glyphs in the console. The
|
2011-03-03 17:23:45 +10:00
|
|
|
characters will appear as they should using Lucida (other than the Sym-
|
2013-07-19 00:14:54 +10:00
|
|
|
bols), but code page will influence them when using a raster font (but of
|
|
|
|
particular interest, 437 and 850 both show the Box Drawings).
|
2011-03-01 21:01:37 +10:00
|
|
|
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Limitations
|
|
|
|
===========
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2017-12-10 22:52:38 +10:00
|
|
|
Tabs can only be set up to column 2048.
|
2017-10-27 21:28:52 +10:00
|
|
|
The saved position will not be restored correctly if the buffer scrolls.
|
2017-11-29 11:06:57 +10:00
|
|
|
Palette sequences only work from Vista.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2017-07-25 18:18:34 +10:00
|
|
|
There may be a conflict with NVIDIA's drivers, requiring the setting of the
|
2013-07-19 00:14:54 +10:00
|
|
|
Environment Variable:
|
2013-02-14 18:35:00 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
ANSICON_EXC=nvd3d9wrap.dll;nvd3d9wrapx.dll
|
2013-02-14 18:35:00 +10:00
|
|
|
|
2014-02-05 00:21:42 +10:00
|
|
|
An application using multiple screen buffers will not have separate
|
|
|
|
attributes in each buffer.
|
|
|
|
|
2017-12-23 10:24:18 +10:00
|
|
|
Console input that is echoed will not be processed (which is probably a
|
|
|
|
good thing for escapes, but not so good for margins).
|
|
|
|
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Version History
|
|
|
|
===============
|
2010-11-08 15:31:01 +10:00
|
|
|
|
|
|
|
Legend: + added, - bug-fixed, * changed.
|
|
|
|
|
2018-02-12 16:44:55 +10:00
|
|
|
1.82-wip - 12 February, 2018:
|
|
|
|
- add ANSICON_WRAP for programs that expect the wrap at right margin.
|
|
|
|
|
2017-12-30 11:46:02 +10:00
|
|
|
1.81 - 28 December, 2017:
|
2017-12-26 16:47:08 +10:00
|
|
|
- fix multiple CRs before LF (including preventing an immediate flush);
|
2017-12-26 18:43:56 +10:00
|
|
|
- fix CR, BS and partial RM during CRM;
|
2017-12-28 12:47:09 +10:00
|
|
|
- fix buffer overflow caused by incorrect critical section;
|
|
|
|
* support the entire 256-color palette;
|
|
|
|
* setting color by index or RGB will use the nearest console color;
|
|
|
|
* setting color by index will leave bold/underline unchanged.
|
2017-12-26 16:47:08 +10:00
|
|
|
|
2017-12-24 10:11:57 +10:00
|
|
|
1.80 - 24 December, 2017:
|
2017-10-28 11:19:06 +10:00
|
|
|
- fix unloading;
|
2017-10-28 16:43:45 +10:00
|
|
|
- fix -e et al when redirecting to CON;
|
2017-10-30 10:50:11 +10:00
|
|
|
- hook CreateFile and CreateConsoleScreenBuffer to force read/write access
|
|
|
|
(fixes redirecting to CON and Microsoft's conio);
|
2017-11-03 23:04:51 +10:00
|
|
|
- fix cursor report with duplicated digits (e.g. "11" was only writing "1");
|
2017-11-24 11:10:42 +10:00
|
|
|
- fix issues with CRM;
|
2017-12-09 22:16:47 +10:00
|
|
|
- fix explicit zero parameters not defaulting to 1;
|
2017-12-14 22:16:55 +10:00
|
|
|
- set color by index (also setting bold/underline);
|
2017-12-23 18:31:37 +10:00
|
|
|
- fix processes that start without a window;
|
2017-12-24 22:39:53 +10:00
|
|
|
- hide the cursor when moving (prevent it displaying on the active buffer
|
|
|
|
when moving on another);
|
2017-12-23 22:04:44 +10:00
|
|
|
* use the system default sound for the bell;
|
2017-12-09 22:16:47 +10:00
|
|
|
* limit parameters to a maximum value of 32767;
|
2017-11-07 11:35:42 +10:00
|
|
|
* go back to saving the buffer cursor position;
|
2017-11-17 21:53:58 +10:00
|
|
|
* preserve escape that isn't part of a sequence;
|
2017-12-14 22:16:55 +10:00
|
|
|
* escaped control characters will display the control;
|
2017-11-29 11:42:47 +10:00
|
|
|
* change the graphics SCAN characters to their Unicode equivalents;
|
2017-12-24 10:11:57 +10:00
|
|
|
* BS/CR/CUB/HVP after wrap will move back to the previous line(s);
|
2017-12-22 18:08:51 +10:00
|
|
|
* improve speed by only flushing when necessary, adding a mode to restore
|
2017-12-23 22:04:44 +10:00
|
|
|
flushing immediately;
|
|
|
|
+ added DA, DECCOLM, DECNCSM, DECOM, DECPS, DECRC, DECSC, DECST8C, DECSTBM,
|
|
|
|
DECSTR, HT, HTS, IND, IRM, NEL, RI, RIS, SCS (only G0 as Special/ASCII),
|
|
|
|
SD, SU and TBC;
|
2017-11-29 11:06:57 +10:00
|
|
|
+ added '+' intermediate byte to use the buffer, rather than the window;
|
2017-12-23 22:04:44 +10:00
|
|
|
+ added set/get palette sequences;
|
2017-12-14 22:16:55 +10:00
|
|
|
+ added the bright SGR colors;
|
2017-12-23 22:04:44 +10:00
|
|
|
+ added -pu to unload from the parent.
|
2017-10-27 21:28:52 +10:00
|
|
|
|
2017-07-25 18:18:34 +10:00
|
|
|
1.72 - 24 December, 2015:
|
|
|
|
- handle STD_OUTPUT_HANDLE & STD_ERROR_HANDLE in WriteFile;
|
|
|
|
- better handling of unusual PE files;
|
|
|
|
* cache GetConsoleMode for an improvement in speed;
|
|
|
|
* files writing to the console always succeed (should mostly remove the
|
2017-12-23 22:04:44 +10:00
|
|
|
need for ANSICON_API);
|
2017-07-25 18:18:34 +10:00
|
|
|
* log: add a blank line between processes;
|
|
|
|
remove the separate line for WriteFile & _lwrite;
|
|
|
|
write byte strings as-is, wide strings using the current code page;
|
|
|
|
use caret notation for control characters, with hexadecimal "^xNN"
|
|
|
|
and "^uNNNN" for characters not in the code page (custom printf);
|
|
|
|
* join multibyte characters split across separate writes;
|
|
|
|
* remove wcstok, avoiding potential interference with the host program;
|
|
|
|
* similarly, remove malloc & friends, using a private heap;
|
|
|
|
+ add CLICOLOR dynamic environment variable.
|
|
|
|
|
2015-10-23 07:49:33 -05:00
|
|
|
1.71 - 23 October, 2015:
|
2017-07-25 18:18:34 +10:00
|
|
|
+ add _CRT_NON_CONFORMING_WCSTOK define for VS2015.
|
2015-10-23 07:49:33 -05:00
|
|
|
|
Recognise more sequences; ignore newline immediately after wrap.
Added support for CHT & CBT (move forward/backward by tabs), DECAWM (don't
wrap at EOL), CRM (display control characters, but still perform newline)
and REP (repeat last character, including BEL, BS, TAB, LF and CR).
It always bugged me that newline would add an unneeded blank line due to
wrap, but not enough to do anything about it. For some reason, adding CRM
got me to thinking about it, so I finally did it.
Stopped \e[K from erasing the first character of the next line.
Restore cursor visibility on unload.
2014-02-26 21:18:45 +10:00
|
|
|
1.70 - 26 February, 2014:
|
2014-02-05 00:21:42 +10:00
|
|
|
- don't hook again if using LoadLibrary or LoadLibraryEx;
|
|
|
|
- update the LoadLibraryEx flags that shouldn't hook;
|
|
|
|
- restore original attributes on detach (for LoadLibrary/FreeLibrary usage);
|
|
|
|
- ansicon.exe will start with ANSICON_DEF (if defined and -m not used);
|
|
|
|
- an installed ansicon.exe will restore current (not default) attributes;
|
2014-02-08 18:30:53 +10:00
|
|
|
- attributes and saved position are local to each console window;
|
2014-02-18 21:34:39 +10:00
|
|
|
- improved recognition of unsupported sequences;
|
2014-02-20 18:06:28 +10:00
|
|
|
- restore cursor to bounds, if size reduced;
|
Recognise more sequences; ignore newline immediately after wrap.
Added support for CHT & CBT (move forward/backward by tabs), DECAWM (don't
wrap at EOL), CRM (display control characters, but still perform newline)
and REP (repeat last character, including BEL, BS, TAB, LF and CR).
It always bugged me that newline would add an unneeded blank line due to
wrap, but not enough to do anything about it. For some reason, adding CRM
got me to thinking about it, so I finally did it.
Stopped \e[K from erasing the first character of the next line.
Restore cursor visibility on unload.
2014-02-26 21:18:45 +10:00
|
|
|
- stop \e[K from erasing first character of next line;
|
|
|
|
- restore cursor visibility on unload;
|
2014-02-05 00:21:42 +10:00
|
|
|
* inject into a created process by modifying the import descriptor table
|
2014-02-08 18:30:53 +10:00
|
|
|
(-p will use CreateRemoteThread);
|
2014-02-05 00:21:42 +10:00
|
|
|
* log: remove the quotes around the CreateProcess command line;
|
2014-02-18 21:34:39 +10:00
|
|
|
add an underscore in 64-bit addresses to distinguish 8-digit groups;
|
|
|
|
* ANSICON_EXC can exclude entire programs;
|
2014-02-20 18:06:28 +10:00
|
|
|
* switch G1 blank from space (U+0020) to No-Break Space (U+00A0);
|
Recognise more sequences; ignore newline immediately after wrap.
Added support for CHT & CBT (move forward/backward by tabs), DECAWM (don't
wrap at EOL), CRM (display control characters, but still perform newline)
and REP (repeat last character, including BEL, BS, TAB, LF and CR).
It always bugged me that newline would add an unneeded blank line due to
wrap, but not enough to do anything about it. For some reason, adding CRM
got me to thinking about it, so I finally did it.
Stopped \e[K from erasing the first character of the next line.
Restore cursor visibility on unload.
2014-02-26 21:18:45 +10:00
|
|
|
* use window height, not buffer;
|
|
|
|
* remove newline after wrap;
|
|
|
|
+ recognise more sequences.
|
2014-02-05 00:21:42 +10:00
|
|
|
|
2013-09-20 03:15:05 +10:00
|
|
|
1.66 - 20 September, 2013:
|
|
|
|
- fix 32-bit process trying to detect 64-bit process.
|
|
|
|
|
2013-09-04 19:37:55 +10:00
|
|
|
1.65 - 4 September, 2013:
|
|
|
|
- fix finding 32-bit LoadLibraryW address from 64-bit;
|
|
|
|
- fix \e[K (was using window, not buffer).
|
|
|
|
|
2013-08-02 23:21:07 +10:00
|
|
|
1.64 - 2 August, 2013:
|
|
|
|
- improved detection of console output.
|
|
|
|
|
2013-07-25 16:42:27 +10:00
|
|
|
1.63 - 25 July, 2013:
|
|
|
|
- don't write the reset sequence (when it's already installed) if output is
|
|
|
|
redirected.
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
1.62 - 18 July, 2013:
|
|
|
|
- indicate if opening HKLM failed;
|
|
|
|
* removed ANSI-LLW.exe again, properly this time;
|
|
|
|
* add the architecture (32- or 64-bit) to the log.
|
|
|
|
|
2013-02-14 18:35:00 +10:00
|
|
|
1.61 - 14 February, 2013:
|
|
|
|
* revert back to using ANSI-LLW.exe, as the new method was unreliable.
|
|
|
|
|
2012-11-24 23:41:29 +10:00
|
|
|
1.60 - 24 November, 2012:
|
|
|
|
* new method to get the 32-bit LoadLibraryW address from 64-bit code.
|
|
|
|
This removes the need for ANSI-LLW.exe, which caused lots of virus
|
|
|
|
warnings, for some reason.
|
|
|
|
- set the code page to display some file names properly;
|
|
|
|
+ expand wildcards for -t (ignoring directories and hidden/binary files).
|
|
|
|
|
2012-06-12 14:38:00 +10:00
|
|
|
1.53 - 12 June, 2012:
|
|
|
|
- fix for multiple simultaneous process creation (e.g. "cl /MP ...").
|
|
|
|
|
2012-06-02 17:20:21 +10:00
|
|
|
1.52 - 2 June, 2012:
|
|
|
|
+ 32-bit processes can inject into 64-bit processes;
|
|
|
|
+ implemented \e[39m & \e[49m (set default foreground/background color);
|
|
|
|
+ added \e[#X, \e[#`, \e[#a, \e[#d, \e[#e, \[e#j and \e[#k;
|
|
|
|
* changed sequence descriptions to those in ECMA-48, ordered by acronym.
|
|
|
|
|
2012-02-24 12:53:07 +10:00
|
|
|
1.51 - 24 February, 2012:
|
|
|
|
- fixed installing into a piped/redirected CMD.EXE;
|
|
|
|
- fixed 32-bit process trying to identify a 64-bit process;
|
|
|
|
- ignore version within core API DLL names (now Win8 works);
|
|
|
|
+ hook _lwrite & _hwrite (now Silverfrost FTN95 v6.20 works).
|
|
|
|
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
1.50 - 14 December, 2011:
|
|
|
|
- -u does not imply -p;
|
|
|
|
- return the program's exit code;
|
|
|
|
- -p by itself will not restore original color;
|
|
|
|
- output error messages to stderr;
|
|
|
|
* logging is always available, with various levels; include the pid;
|
2013-07-19 00:14:54 +10:00
|
|
|
* don't automatically hook GUI programs, use 'ansicon' or ANSICON_GUI;
|
Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked. This should work around the nvd3d9wrap.dll issue. Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG. A side-effect caused debugstr.c to move to util.c.
GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable. Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.
Due to an email requesting a reverse video option, realised I always take the
current attributes as default. This means if you turned on reverse and ran a
program, it would take the reverse as its default. Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background). (The difference from "\e[7m" is that it
won't be reset on "\e[m".)
A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload). The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.
Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.
Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
|
|
|
* always place first in AutoRun; don't run if already installed;
|
|
|
|
+ global reverse video capability;
|
|
|
|
+ added ANSICON_VER to provide version/install test;
|
|
|
|
+ added ANSICON_EXC to exclude selected modules;
|
|
|
|
+ added ANSICON_DEF to explicitly set the default SGM.
|
|
|
|
|
2011-03-03 17:26:14 +10:00
|
|
|
1.40 - 1 March, 2011:
|
2011-03-01 21:01:37 +10:00
|
|
|
- hook GetProcAddress (now PowerShell works);
|
|
|
|
+ add SO/SI, using the DEC Special Graphics Character Set for G1;
|
|
|
|
+ add DECTCEM to show/hide the cursor.
|
|
|
|
|
2010-12-22 18:47:45 +10:00
|
|
|
1.32 - 22 December, 2010:
|
2010-12-04 15:29:58 +10:00
|
|
|
- fixed crash due to NULL lpNumberOfBytesWritten/lpNumberOfCharsWritten;
|
2010-12-12 21:58:35 +10:00
|
|
|
- -p will test the parent process for validity;
|
|
|
|
* hook into GUI processes;
|
2010-12-22 18:47:45 +10:00
|
|
|
+ recognise DSR and xterm window title sequences;
|
|
|
|
- fixed MinGW32 binaries (LLW was wrong).
|
2010-12-04 15:29:58 +10:00
|
|
|
|
2010-11-19 15:50:10 +10:00
|
|
|
1.31 - 19 November, 2010:
|
2010-11-13 14:49:27 +10:00
|
|
|
- fixed multibyte support (no extra junk with UTF-8 files);
|
2010-11-19 15:50:10 +10:00
|
|
|
* provide workaround for API byte/character differences;
|
2010-11-13 14:49:27 +10:00
|
|
|
* fixed potential problem if install path uses Unicode.
|
|
|
|
|
2010-11-08 15:31:01 +10:00
|
|
|
1.30 - 7 September, 2010:
|
|
|
|
+ x64 version.
|
|
|
|
|
|
|
|
1.25 - 22 July, 2010:
|
|
|
|
- hook LoadLibraryEx (now CScript works);
|
|
|
|
- fixed -i when AutoRun existed, but was empty;
|
|
|
|
+ support for Windows 7;
|
|
|
|
+ -I (and -U) use HKEY_LOCAL_MACHINE.
|
|
|
|
|
|
|
|
1.24 - 7 January, 2010:
|
|
|
|
- fix -t and -e when ANSICON was already running;
|
|
|
|
+ read standard input if redirected with no arguments, if -t has no
|
|
|
|
files, or if the name is "-" (which also serves as a workaround for
|
|
|
|
programs that don't get hooked, such as CScript).
|
|
|
|
|
|
|
|
1.23 - 11 November, 2009:
|
|
|
|
- restore hooked functions when unloading;
|
|
|
|
- reverse the "bold" and "underline" settings;
|
|
|
|
* conceal characters by making foreground color same as background.
|
|
|
|
|
|
|
|
1.22 - 5 October, 2009:
|
|
|
|
- hook LoadLibrary to inject into applications started via association.
|
|
|
|
|
|
|
|
1.21 - 23 September, 2009:
|
|
|
|
+ -i (and -u) option to add (remove) entry to AutoRun value.
|
|
|
|
|
|
|
|
1.20 - 21 June, 2009:
|
|
|
|
* use another injection method;
|
|
|
|
+ create ANSICON environment variable;
|
|
|
|
+ -e (and -E) option to echo the command line (without newline);
|
|
|
|
+ -t (and -T) option to type (display) files (with file name).
|
|
|
|
|
|
|
|
1.15 - 17 May, 2009:
|
|
|
|
- fix output corruption for long (over 8192 characters) ANSI strings.
|
|
|
|
|
|
|
|
1.14 - 3 April, 2009:
|
|
|
|
- fix the test for an empty import section (eg. XCOPY now works).
|
|
|
|
|
|
|
|
1.13 - 21 & 27 March, 2009:
|
|
|
|
* use a new injection method (to work with DEP);
|
|
|
|
* use Unicode.
|
|
|
|
|
|
|
|
1.12 - 9 March, 2009:
|
|
|
|
- fix processing child programs (generate a relocatable DLL).
|
|
|
|
|
|
|
|
1.11 - 28 February, 2009:
|
|
|
|
- fix processing child programs (only use for console executables).
|
|
|
|
|
|
|
|
1.10 - 22 February, 2009:
|
|
|
|
- fix output corruption (buffer overflow in MyConsoleWriteW);
|
|
|
|
- recognise current screen attributes as current ANSI atrributes;
|
|
|
|
- ignore Ctrl+C and Ctrl+Break;
|
|
|
|
+ process child programs.
|
|
|
|
|
|
|
|
1.01 - 12 March, 2006:
|
|
|
|
* \e[m will restore original color, not set grey on black;
|
|
|
|
+ -m option to set default (and initial) color;
|
|
|
|
- restore original color on exit;
|
|
|
|
- disable escape processing when console has disabled processed output;
|
|
|
|
+ \e[5m (blink) is the same as \e[4m (underline);
|
|
|
|
- do not conceal control characters (0 to 31).
|
|
|
|
|
|
|
|
1.00 - 23 October, 2005:
|
|
|
|
+ initial release.
|
|
|
|
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Acknowledgments
|
|
|
|
===============
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Jean-Louis Morel, for his Perl package Win32::Console::ANSI. It provided
|
|
|
|
the basis of 'ANSI.dll'.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Sergey Oblomov (hoopoepg), for Console Manager. It provided the basis of
|
|
|
|
'ansicon.exe'.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Anton Bassov's article "Process-wide API spying - an ultimate hack" in "The
|
|
|
|
Code Project".
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Richard Quadling - his persistence in finding bugs has made ANSICON what it
|
|
|
|
is today.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Dmitry Menshikov, Marko Bozikovic and Philippe Villiers, for their assis-
|
|
|
|
tance in making the 64-bit version a reality.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2010-12-12 21:58:35 +10:00
|
|
|
Luis Lavena and the Ruby people for additional improvements.
|
|
|
|
|
2011-03-04 10:55:06 +10:00
|
|
|
Leigh Hebblethwaite for documentation tweaks.
|
2011-03-01 21:01:37 +10:00
|
|
|
|
2013-09-04 19:37:55 +10:00
|
|
|
Vincent Fatica for pointing out \e[K was not right.
|
2017-11-03 23:04:51 +10:00
|
|
|
Nat Kuhn for pointing out the problem with report cursor position.
|
2013-09-04 19:37:55 +10:00
|
|
|
|
2017-12-28 12:47:09 +10:00
|
|
|
Thiadmer Riemersma for the nearest color algorithm.
|
|
|
|
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Contact
|
|
|
|
=======
|
2010-11-08 15:31:01 +10:00
|
|
|
|
|
|
|
mailto:jadoxa@yahoo.com.au
|
2013-07-19 00:14:54 +10:00
|
|
|
http://ansicon.adoxa.vze.com/
|
2010-12-12 21:58:35 +10:00
|
|
|
https://github.com/adoxa/ansicon
|
2010-11-08 15:31:01 +10:00
|
|
|
|
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
Distribution
|
|
|
|
============
|
2010-11-08 15:31:01 +10:00
|
|
|
|
2013-07-19 00:14:54 +10:00
|
|
|
The original zipfile can be freely distributed, by any means. However, I
|
|
|
|
would like to be informed if it is placed on a CD-ROM (other than an arch-
|
|
|
|
ive compilation; permission is granted, I'd just like to know). Modified
|
|
|
|
versions may be distributed, provided it is indicated as such in the ver-
|
|
|
|
sion text and a source diff is made available. In particular, the supplied
|
|
|
|
binaries are freely redistributable. A formal license (zlib) is available
|
|
|
|
in LICENSE.txt.
|
2010-11-08 15:31:01 +10:00
|
|
|
|
|
|
|
|
2017-12-10 22:52:38 +10:00
|
|
|
==============================
|
2018-02-12 16:44:55 +10:00
|
|
|
Jason Hood, 12 February, 2018.
|