home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / msdos / misc / 6747 < prev    next >
Encoding:
Text File  |  1992-12-29  |  2.7 KB  |  70 lines

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