home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.misc
- Path: sparky!uunet!microsoft!hexnut!jenk
- From: jenk@microsoft.com (Jen Kilmer)
- Subject: Re: ANSI ESC sequence, how??
- Message-ID: <1992Dec29.052514.10829@microsoft.com>
- Date: 29 Dec 92 05:25:14 GMT
- Organization: Microsoft Corporation
- References: <1992Dec23.195236.28511@netcom.com> <i3BDwB1w165w@netlink.cts.com>
- Lines: 59
-
- In article <i3BDwB1w165w@netlink.cts.com> mshapiro@netlink.cts.com (Michael Shapiro) writes:
- >mjb@netcom.com (Martin Brown) writes:
- >> I have ansi.sys installed, and have received some ansi msg's that seem to be
- >> working. Now that I want to do some ansi coding, I can't figure out how to
- >> actually enter (which keys to push) the 'esc' part of the sequence. I'm tryi
- >> to do this at the command prompt.
- >>
- >> Take for instance changing the screen background to blue. The manual shows:
- >>
- >> ESC[44m
- >>
- >He then asks how you can send an ANSI ESC sequence to the screen....
-
- You can enter ansi sequences directly from the prompt by putting them
- in the prompt :-) That is, you can set an environment variable to tell
- ms-dos (well, command.com, really :) what prompt to display - for example,
-
- prompt yes, mistress?
- or
- set prompt=yes, mistress?
-
- will cause ms-dos to display
-
- yes, mistress?
-
- whenever it's waiting for you to tell it what to do. There are also
- some predefined codes you can use - like $p for the current path, or
- $g for a greater-than, or $v for the os version, or $t for the time,
- or $E for the ESCape character :)
-
- The prompt I set on bootup is:
-
- $e[0;60;"smartdrv /c";13p$e["{";"{"p$e[1;33mDOS! $e[32;40m$p$e[0;37m$g
-
- This remaps F2 to flush smartdrv, remaps the curly brace (I was in
- product support and once in a blue moon someone would call about this
- - so I packed my prompt with ready examples :) sets up high-intensity
- yellow, writes DOS! , then changes color to green, writes the current
- drive/path, and changes to low-intensity white for the greater-than.
-
- If you're using windows 3.1, you can have a different prompt when at
- a prompt under windows by setting a winpmt variable. I have:
-
- set winpmt=$e[1;32m[win] $e[36;40m$p$e[35m$g
-
- F2 still works, btw - any key remappings stay til you cancel them.
- Colors don't always return after starting another program, tho, so
- it's useful to have them in the prompt.
-
- You can also put escape keys into a file using edit or edlin. Naturally
- I'm blanking on how to do it with edit, with edlin you enter ctrl characters
- by using ctrl-v instead of ctrl-. Since esc is also ctrl-[, you'd enter
- ctrl-v,[. To enter ctrl-c, it's ctrl-v,C (not ctrl-v,c).
-
- Edit...enter ctrl-p, ESC; or ctrl-p, ctrl-[; or ctrl-p, alt-027.
-
- -jen
- I'm not speaking for microsoft, I've just used DOS too much.
-
-