免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10478 | 回复: 8
打印 上一主题 下一主题

VT100控制码[z [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-04-24 17:11 |只看该作者 |倒序浏览
http://www.cyut.edu.tw/~ckhung/olbook/liblet/vt100_reference_card.txt

经常见大家在问printf("\027[10"等是什么意思
这种就是VT100控制码
用于控制屏幕等终端设备的属性
同样可以向打印机等输出

VT100以ESC开始,在TELNET终端上同样可以使用VT100命令实现光标移动等终端控制操作

现列出如下


  1. Article 248 of comp.terminals:
  2. Newsgroups: comp.terminals
  3. Path: cs.utk.edu!gatech!udel!bogus.sura.net!opusc!usceast!chan
  4. From: chan@ece.scarolina.edu (Simon Chan)
  5. Subject: VT100 Reference Card !! ( if you are looking for....)
  6. Message-ID: <chan.728236678@hertz>;
  7. Keywords: vt100 terminal escape codes
  8. Sender: usenet@usceast.cs.scarolina.edu (USENET News System)
  9. Organization: USC  Department of Computer Science
  10. Date: 28 Jan 93 15:57:58 GMT
  11. Lines: 162



  12. Taken from VT100 Programming Reference Card (DIGITAL)

  13. ANSI Compatible Mode

  14.         Cursor Movement Commands
  15.                 Cursor up                       ESC [ Pn A
  16.                 Cursor down                     ESC [ Pn B
  17.                 Cursor forward (right)          ESC [ Pn C
  18.                 Cursor backward (left)          ESC [ Pn D
  19.                 Direct cursor addressing        ESC [ Pl; Pc H  or
  20.                                                 ESC [ Pl; Pc f
  21.                 Index                           ESC D
  22.                 Next Line                       ESC E
  23.                 Reverse index                   ESC M
  24.                 Save cursor and attributes      ESC 7
  25.                 Restore cursor and attributes   ESC 8
  26.                 * Pn = decimal parameter in string of ASCII digits.(default 1)
  27.                 * Pl = line number (default 0); Pc = column number (default 0)

  28.         Line Size (Double-Height and Double-Width) Commands
  29.                 Change this line to double-height top half      ESC # 3
  30.                 Change this line to double-height bottom half   ESC # 4
  31.                 Change this line to single-width single-height  ESC # 5
  32.                 Change this line to double-width single-height  ESC # 6

  33.         Character Attributes
  34.                 ESC [ Ps;Ps;Ps;...,Ps m
  35.                 Ps =    0 or None       All Attributes Off
  36.                         1               Bold on
  37.                         4               Underscore on
  38.                         5               Blink on
  39.                         7               Reverse video on
  40.                 Any other parameter values are ignored.

  41.         Erasing
  42.                 From cursor to end of line              ESC [ K  or ESC [ 0 K
  43.                 From beginning of line to cursor        ESC [ 1 K
  44.                 Entire line containing cursor           ESC [ 2 K
  45.                 From cursor to end of screen            ESC [ J  or ESC [ 0 J
  46.                 From beginning of screen to cursor      ESC [ 1 J
  47.                 Entire screen                           ESC [ 2 J

  48.         Programmable LEDs
  49.                 ESC [ Ps;Ps;...Ps q
  50.                 Ps =    0 or None       All LEDs Off
  51.                         1               L1 on
  52.                         2               L2 on
  53.                         3               L3 on
  54.                         4               L4 on
  55.                 Any other parameter values are ignored.

  56.         Character Set (G0 and G1 Designators)
  57.                 Charactor Set                   G0 Designator   G1 Designator
  58.                 United Kingdom (UK)             ESC ( A         ESC ) A
  59.                 United States (USASCII)         ESC ( B         ESC ) B
  60.                 Special graphics characters     ESC ( 0         ESC ) 0
  61.                  and line drawing set
  62.                 Alternate character ROM         ESC ( 1         ESC ) 1
  63.                 Alternate character ROM         ESC ( 2         ESC ) 2
  64.                  special graphics characters

  65.         Scrolling Region
  66.                 ESC [ Pt ; Pb r
  67.                 Pt is the number of the top line of the scrolling region;
  68.                 Pb is the number of the bottom line of the scrolling region
  69.                 and must be greater than  Pt.
  70.                 (The default for Pt is line 1, the default for Pb is the end
  71.                  of the screen)

  72.         TAB stops
  73.                 Set tab at current column               ESC H
  74.                 Clear tab at curent column              ESC [ g or ESC [ 0 g
  75.                 Clear all tabs                          ESC [ 3 g

  76.         Modes
  77.                                   To Set                To Reset
  78.         Mode Name            Mode        Sequence   Mode        Sequence
  79.         Line feed/new line   New line    ESC [20h   Line feed   ESC [20l
  80.         Cursor key mode      Application ESC [?1h   Cursor      ESC [?l
  81.         ANSI/VT52 mode       ANSI        N/A        VT52        ESC [?2l
  82.         Column mode          132 Col     ESC [?3h   80 Col      ESC [?3l
  83.         Scrolling mode       Smooth      ESC [?4h   Jump        ESC [?4l
  84.         Screen mode          Reverse     ESC [?5h   Normal      ESC [?5l
  85.         Origin mode          Relative    ESC [?6h   Absolute    ESC [?6l
  86.         Wraparound           On          ESC [?7h   Off         ESC [?7l
  87.         Auto repeat          On          ESC [?8h   Off         ESC [?8l
  88.         Interlace            On          ESC [?9h   Off         ESC [?9l
  89.         Graphic proc. option On          ESC 1      Off         ESC 2
  90.         Keypad mode          Application ESC =      Numeric     ESC >;

  91.         Reports
  92.                 Cursor Position Report
  93.                 Invoked by                      ESC [ 6 n
  94.                 Response is                     ESC [ Pl; Pc R
  95.                 * Pl = line number; Pc = column number

  96.         Status Report
  97.                 Invoked by                      ESC [ 5 n
  98.                 Response is                     ESC [ 0 n  (terminal ok)
  99.                                                 ESC [ 3 n  (terminal not ok)

  100.         What Are You
  101.                 Invoked by                      ESC [ c  or  ESC [ O c
  102.                 Response is                     ESC [ ?1 ; Ps C
  103.                 Ps =    0       Base VT100, no options
  104.                         1       Processor option (STP)
  105.                         2       Advanced Video option (AVO)
  106.                         3       AVO and STP
  107.                         4       Graphocs processor option (GO)
  108.                         5       GO and STP
  109.                         6       GO and AVO
  110.                         7       GO, STP, and AVO
  111.         Alternately invoked by ESC Z (not recommended.) Response is the same.

  112.         Reset
  113.                 ESC c

  114.         Confidence Tests
  115.         Fill Screen with "Es"           ESC # 8
  116.         Invoke Test(s)                  ESC [ 2 ; Ps y
  117.         Ps =    1                               Power-up self test
  118.                                                 (ROM checksum, RAM, NVR,
  119.                                                 keyboard and AVO if installed)
  120.                 2(loop back connector required) Data Loop Back
  121.                 4(loop back connector required) ETA Modern Control Test
  122.                 8                               Repeat selected test(s)
  123.                                                 indefinitely
  124.                                                 (until failure or power off)

  125. VT52 Compatible Mode
  126.         Cursor Up                               ESC A
  127.         Cursor Down                             ESC B
  128.         Cursor Right                            ESC C
  129.         Cursor Left                             ESC D
  130.         Select Special Graphics character set   ESC F
  131.         Select ASCII character set              ESC G
  132.         Cursor to home                          ESC H
  133.         Reverse line feed                       ESC I
  134.         Erase to end of screen                  ESC J
  135.         Erase to end of line                    ESC K
  136.         Direct cursor address                   ESC Ylc         (see note 1)
  137.         Identify                                ESC Z           (see note 2)
  138.         Enter alternate keypad mode             ESC =
  139.         Exit alternate keypad mode              ESC >;
  140.         Enter ANSI mode                         ESC <

  141.         NOTE 1: Line and column numbers for direct cursor address are single
  142.                 character codes whose values are the desired number plus
  143.                 37 (in Octal). Line and column numbers start at 1.
  144.         NOTE 2: Response to ESC Z is ESC / Z.



  145. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  146. Simon Chan                                      chan@ece.scarolina.edu
  147. Department of Electrical & Computer Engineering
  148. Swearingen Engineering Centre
  149. University of South Carolina
  150. Coulmbia, South Carolina 29208
  151. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


  152. Article 269 of comp.terminals:
  153. Path: cs.utk.edu!gatech!news.ans.net!cmcl2!adm!smoke!gwyn
  154. From: gwyn@smoke.brl.mil (Doug Gwyn)
  155. Newsgroups: comp.terminals
  156. Subject: Re: VT100 Reference Card !!
  157. Keywords: vt100 terminal escape codes
  158. Message-ID: <19629@smoke.brl.mil>;
  159. Date: 1 Feb 93 15:01:49 GMT
  160. References: <chan.728236678@hertz>;
  161. Organization: U.S. Army Ballistic Research Lab, APG MD.
  162. Lines: 25

  163. In article <chan.728236678@hertz>; chan@ece.scarolina.edu (Simon Chan) writes:
  164. >;Taken from VT100 Programming Reference Card (DIGITAL)

  165. Note that EK-VT100-RC-001 contains several errors and omissions.
  166. The errors appear to all be fixed in the posted version.
  167. Here are some additions:

  168.         Parameters to Direct cursor addressing can be omitted if 1.
  169.         "Index" is broken if NEWLINE is enabled (set-up).
  170.         "Reverse index" scrolls up retaining the same column.

  171.         CHARACTER SET DESIGNATORS: G0 = Shift-In, G1 = Shift-Out

  172. >;       ANSI/VT52 mode       ANSI        N/A        VT52        ESC [?2l
  173.         ANSI/VT52 mode       ANSI        ESC <      VT52        ESC [?2l
  174.         Modes can be combined using ";", for example "ESC [ ? 3 ; 4 ; 7 h"

  175.         CONFIDENCE TESTS: Parameter bits are summed into one parameter.

  176.         Hardcopy                ESC # 7
  177.         Graphic processor ON    ESC 1
  178.         Graphic processor OFF   ESC 2

  179. The reference card showed incorrect graphics for octal code 140; its
  180. correct graphic is ` (accent grave).





复制代码

论坛徽章:
0
2 [报告]
发表于 2003-04-24 17:29 |只看该作者

VT100控制码[z

那请问 对于命令:

ESC + ‘C’(0x43)+‘0’(0x30)+0x0d+0x0a

用echo 如何执行呢

论坛徽章:
0
3 [报告]
发表于 2003-04-24 17:29 |只看该作者

VT100控制码[z

那请问 对于命令:

ESC + ‘C’(0x43)+‘0’(0x30)+0x0d+0x0a

用echo 如何执行呢

论坛徽章:
0
4 [报告]
发表于 2003-04-24 18:02 |只看该作者

VT100控制码[z

0x0d+0x0a
这就是回车
你输入
Esc键
再输入C'大写
再输入字母'0'

再回车

这些命令在linux上终端也可以输入的

所以如果想改变自己的屏幕显示或是移动光标的话很方便

论坛徽章:
0
5 [报告]
发表于 2003-06-18 20:53 |只看该作者

VT100控制码[z

http://www.vt100.net/docs/vt100-ug/

用户指南

论坛徽章:
0
6 [报告]
发表于 2003-06-18 21:02 |只看该作者

VT100控制码[z

用户指南写得很详细

值得一读

论坛徽章:
0
7 [报告]
发表于 2003-06-19 08:59 |只看该作者

VT100控制码[z

怎么联不上呀!老大!

论坛徽章:
0
8 [报告]
发表于 2003-06-19 12:52 |只看该作者

VT100控制码[z

我这边都可以啊

论坛徽章:
0
9 [报告]
发表于 2003-06-19 16:27 |只看该作者

VT100控制码[z

正好需要
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP