Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1944560
  • 博文数量: 610
  • 博客积分: 11499
  • 博客等级: 上将
  • 技术积分: 5511
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-12 19:27
文章分类

全部博文(610)

文章存档

2016年(5)

2015年(18)

2014年(12)

2013年(16)

2012年(297)

2011年(45)

2010年(37)

2009年(79)

2008年(101)

分类: LINUX

2008-03-25 22:17:02




    这个问题是很古老的问题了,主要涉及到backspace键和delete键的键码映射问题。详细的理解部分可以参考:。
 

The keymapping problem can be traced back to the time when computers used punched tapes. The only way to correct a wrongly punched character was to punch additional bits in the tape (or rather, punch additional bits _out_ of the tape). Characters with all the bits punched were treated as deleted characters. See 'man ascii' for a list of the ASCII characterset, you'll see that DEL, (octal 177, decimal 127 and hexadecimal 7F) is the one with all the bits punched in (the ASCII code with the highest value). To be able to overwrite a character it is necessary to undo the feed between the characters first. For this the ASCII BS (octal 010, decimal 8, hexadecimal 08) was used. So to erase the last-typed character, you would have to press first BS to move back one character, and then DEL to delete the character. In newer computers either BS or DEL was chosen to move back and delete in one press.

 
    BS(BackSpace) == 0x08  == ^H
    DEL(DELete)  == 0x7F  == ^?
 
    现在host上已经很好的解决了这个问题,但是在嵌入式系统中,还是会出现这个问题,上述文章中提到的通用的解决办法不太适合嵌入式应用,所以暂行的解决 办法有:根据你使用的终端,来重新设置码值映射关系。比如我现在使用的是SecureCRT,在会话选项-->映射键-->选中 Backspace发送delete,那么在tinylogin和telnet登陆时,退格键就不会打印出^H,而是正常了。如果不修改,这时候 backspace又不起作用,那么试一下ctrl+backspace.
阅读(1305) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~