상세 컨텐츠

본문 제목

What Key Combination Generates A Backspace Character In Unix

카테고리 없음

by forcecinabino 2020. 10. 6. 22:22

본문



My Backspace Key doesn't work!

  1. What Key Combination Generates A Backspace Character In Unix Code
  2. What Key Combination Generates A Backspace Character In Unix Tutorial
  3. What Key Combination Generates A Backspace Character In Unix Word
  4. What Key Combination Generates A Backspace Character In Unix Code

The short answer:

Then, if necessary:

Backspace key vs Backspace character. A lot of people confuse the two. Backspace key on keyboard has almost the universal function to delete the previous character (= move cursor back and delete that character). The backspace character ' b' however only moves the cursor one position back in the console window and doesn't delete it. While everyone is familiar with using the Backspace key to delete the previous character, reaching for the key often requires some minor finger gymnastics, and it only deletes a single character at a time. In IPython there are several shortcuts for removing some portion of the text you're typing.

  • Make the emulator send what the host expects, OR:

What key combination generates a backspace character in unix download

The long version:

Terminal emulation lets you use your PC to make a connection to anothercomputer and interact with it as if your PC were a terminal, even thoughyour PC is not really a terminal and almost certainly does not have thesame kind of keyboard as the terminal it is emulating.

One of the most confusing aspects of terminal emulation is making the PC keysdo what their keytops say they do. Many people find it quite surprising whenthe Backspace key doesn't backspace, the Arrow keys don't move the cursor, theInsert key doesn't insert, and so on. In general only the letter and digitkeys on the main keypad can be depended upon to act as their labels suggest.The rest, well.. each has its own story. This is the story of the Backspacekey.

  • This discussion applies mainly to PC-based versions of Kermit:Kermit 95 andMS-DOS Kermit, which include full key-mappingcapabilities. C-Kermit for UNIX (includingLinux, FreeBSD, AIX, Solaris, HP-UX, etc) has a limited key-mapping featurethat allows backspace/delete configuration. However, most of the discussionis general information that should be useful regardless of connectionmethod and software.
  • Terms like 'left' and 'right' are used in thecontext of left-to-right writing systems like English, Russian, or Greek. Forright-to-left scripts like Hebrew, the directionality is reversed.

First some terminology. 'Backspace' might (or might not) be the name of akey. For example, it is printed on the keytop of the large key at the upperright of main keypad on the PC 101 keyboard. On the DEC keyboard, the samekey is labeled with a symbol (

<X]

) insteadof a word. 'Backspace' is also is the name of an ASCII controlcharacter (ASCII value 8), which might or might not be associated with theBackspace key. 'Backspace' is also an abstract concept relating to computers,terminals, and typewriters, having at least two distinct meanings:

  • To erase the character left of the active position (cursor), andsimultaneously move the cursor to the position previously occupied by thatcharacter. This is called a destructive backspace.
  • To move the cursor one space to the left into the same position as thecharacter that was previously to its left, without erasing that character.This is a nondestructive backspace. Nondestructive backspacing isusually done with the Left Arrow key, discussedelsewhere.

To confuse matters even further, your keyboard might have keys other thanBackspace that suggest a destructive backspace capability. For example, PCkeyboads include both a 'Del' and 'Delete' key and one or two Left Arrow keysin addition to the Backspace key. These are strictly for local PCfunctions and not, in general, for sending characters to the host (but ofcourse in Kermit you can map them to do whatever you want).

To cause a destructive backspace operation, the terminal must send anappropriate code to the host, and the host must reply with appropriateterminal-specific codes to move the terminal's cursor and remove the unwantedcharacter. Unfortunately, different hosts and applications use differentcharacters (or sequences) for destructive backspace (and of course, differentterminals use different codes for screen formatting). The terminal emulator,Kermit or otherwise, has no way of knowing what host or application you areusing, or how it is configured, and therefore no way of knowing what to sendwhen you press the Backspace key.

Of course, Kermit's Backspace key must send something 'out of thebox', i.e. in the absence of specific instructions from you. This isdefault backspace assignment. Each emulation (VT100, Wyse 60,Televideo, etc) has an appropriate default assignment, namely what thecorresponding key on the real terminal sends.

Therefore, it should be sufficient to inform the host you are connected toabout your terminal type, and then it should expect the destructive backspacecode that is associated with that terminal. In practice, however, this israrely enough. In Unix(*), for example,the terminal driver has no connection with the terminal database, sosetting or changing your terminal type in Unix has no effect on the charactersit uses for destructive backspace (or other forms of editing, such as wordand line deletion).

For most emulations Kermit uses one of the two mostlikely destructive backspace values, and in fact the one that is defined inASCII to be destructive backspace, in most cases Rubout (RUB), also known asDelete (DEL), character number 127, which sometimes is displayed as'

^?

'. Lest anyone believe this is a frivolous choice, wequote from American National Standard X3.4-1977, Section 5.1, ControlCharacters:

  • 0/8 BS (Backspace). A one-active-position format effector thatmoves the position backward on the same line.
  • 7/15 DEL (Delete). Also known as RUB (Rubout). A character usedprimarily to erase or obliterate an erroneous or unwanted character..

(Certain other emulations have their own defaults. For example Data GeneralDASHER terminals use Control-Y for character deletion, because that is whatData General operating systems such as AOS/VS expect.)

What happens if the wrong choice is made? If Delete is chosen but is not thehost's destructive backspace character, it is likely to:

  • Interrupt or cancel the current command (default SIGINT in many Unixes).
  • Be accepted as a data character and echo as '^?'.
  • Be ignored.

If Backspace is chosen but is not the host's destructive backspace character,it is likely to:

  • Move the cursor to the beginning of the current line (VMS).
  • Perform a nondestructive backspace.
  • Be accepted as a data character and echo as '^H'.
  • Enter 'help mode' (EMACS).
  • Recall the correct part of a failing command (TOPS-20).

Even when the host terminal driver uses a specific charactersuch as Backspace for erasure, this does not guarantee that all applicationsalso use it. One well-known case in point is EMACS, which -- in effect --replaces the terminal driver with its own; in EMACS, control-characters areused as commands: Ctrl-H for Help, Ctrl-B for (cursor) Back, Ctrl-F for(cursor) Forward, etc. If you find EMACS's key definitions disconcerting,you can change them, e.g.: License key generator from serial.

Select an Appropriate Terminal Emulation

The first step in making your Backspace key behave as expected is to choose anterminal emulation in Kermit that is appropriate for the computer your areconnecting to, and then (if necessary) tell your host what kind of terminalKermit is emulating. The command for choosing a terminal emulation in Kermitis:

Type a question mark (

?

) in place of the name to get a listof the available emulations. Here are some examples:

When the most appropriate emulation is not available, most hosts alsosupport VT100 and/or Wyse 50 or 60.

Inform the Host of Your Terminal Type

The command for telling your host what terminal type you have depends onthe host operating system and, in the case of Unix, also on the shell.Some examples (for the DEC VT100 terminal type):

After that, if the Backspace key still does not work, you have twochoices:

  • Change Kermit to send what the host expects.
  • Change the host to expect what Kermit sends.

What Key Combination Generates A Backspace Character In Unix Code

Well, sometimes three choices. If the Backspace key sends the DEL characterbut the host wants the Backspace character, you can type Ctrl-H (hold down theCtrl key and press the 'h' key) instead of using the Backspace key.

Changing What Kermit's Backspace Key Sends

Kermit's SET KEY command lets you redefine the Backspace key (or any otherkey) to send whatever you want it to send (or to take any other actions).

The SET KEY command has two operands: a unique identifier for a key or keycombination, called a keycode, and the value or action to be assignedto the key, called the definition:

In Kermit commands, a keycode is a number preceded by a backslash. Keycodesare likely to be different for different operating systems, keyboards, and/orKermit programs. In particular:

(You can find out the keycode of any key or key combination by giving theSHOW KEY command. Kermit prompts you to press a key; you can press any keyor key combination and Kermit tells you the keycode.)

As noted above, the characters most commonly used by terminals to send adestructive backspace command to a host computer are single ASCII controlcharacters: Delete and Backspace. Control characters are entered into SETKEY and other Kermit commands by their numeric ASCII value, preceded bybackslash (which tells Kermit that these are character codes, rather thanliteral digits). Here are the characters used for destructive backspace, indecreasing order of likelihood (numbers are shown in decimal):

(Number sign was used on very old Unix systems that were accessed fromTeletype hardcopy terminals; this original Unix default is still foundhere and there. CCH is an 8-bit (C1) control character from ISO 6429,which has a 7-bit coding as the sequence ESC followed by the letter T.)

Now let's put all this together to show the possible combinations:

Of course other arrangements are possible too. Remember, you can assignany definition you want to any key or key combination. Some people mightprefer to have Backspace always send DEL and (say) Shift-Backspace orControl-Backspace always send Ctrl-H (or vice versa). Example for K95:

Where do I put these commands? You can give SET KEY commands at theKermit prompt, or you can put them in your Kermit customization file:

MSCUSTOM.INI

for MS-DOS Kermit;

K95CUSTOM.INI

for Kermit 95.

In Kermit 95, if you use the Dialer to make connections, you can alsochoose the Backspace-key action for each connection on the Keyboardpage of the Dialer notebook for that connection.

What Key Combination Generates A Backspace Character In Unix Tutorial

Changing What the Host Expects

In the days of real terminals, there was no way to change what a terminal'sBackspace (or equivalent) key sent. Therefore host operating systems suchas Unix(*) that did not require a certain kind of terminalfor access had to provide a method for adapting to different terminals.

Other host operating systems (such as VMS) always expect the same characterfor destructive backspace and you can't change it; in the VMS case, you simplyhave no choice but to configure your emulator to send DEL.

Unix hosts, however, let you change your editing and interruption characters(and much else besides) with the

stty

command. Theparticulars of this command vary greatly from one Unix variety to another, soyou'll need to view the documentation by typing one of the following commandsat the Unix shell prompt:

Here are a few examples:

Quoting requirements might vary from shell to shell (sh, ksh, bash, tcsh, etc).When in doubt use doublequotes as shown in many of the examples above.Note that in all cases above, the '

^

' character is 'circumflex'or 'caret', normally produced by typing Shift-6. In other words, '

^h

'in an stty command is circumflex followed by the letter 'h', not Control-Hitself. Also note that case might be significant in the control-characterletter name: 'h' or 'H'.

______________

*Remember, 'Unix' is a genericterm covering dozens of specific operating systems, such as Linux, FreeBSD,AIX, HP-UX, Solaris, and lots of others.

Links to related info at other sites (likely to change or disappear atany time):

[ Kermit FAQ ] [ C-Kermit ] [ Kermit 95 ] [ MS-DOS Kermit ] [ Kermit Home ]

What Key Combination Generates A Backspace Character In Unix Word

The Kermit FAQ / The Kermit Project / Columbia University / kermit@columbia.edu / 27 Apr 2001

What Key Combination Generates A Backspace Character In Unix Code

Character Sequence
backspace Alt 8
tab Alt 9
line break Alt 10
¤ Alt 15
Alt 20
§ Alt 21
paste Alt 22
space Alt 32
! Alt 33
' Alt 34
# Alt 35
$ Alt 36
% Alt 37
& Alt 38
' Alt 39
( Alt 40
) Alt 41
* Alt 42
+ Alt 43
, Alt 44
- Alt 45
. Alt 46
/ Alt 47
0 Alt 48
1 Alt 49
2 Alt 50
3 Alt 51
4 Alt 52
5 Alt 53
6 Alt 54
7 Alt 55
8 Alt 56
9 Alt 57
: Alt 58
; Alt 59
< Alt 60
= Alt 61
> Alt 62
? Alt 63
@ Alt 64
A Alt 65
B Alt 66
C Alt 67
D Alt 68
Character Sequence
E Alt 69
F Alt 70
G Alt 71
H Alt 72
I Alt 73
J Alt 74
K Alt 75
L Alt 76
M Alt 77
N Alt 78
O Alt 79
P Alt 80
Q Alt 81
R Alt 82
S Alt 83
T Alt 84
U Alt 85
V Alt 86
W Alt 87
X Alt 88
Y Alt 89
Z Alt 90
[ Alt 91
  Alt 92
] Alt 93
^ Alt 94
_ Alt 95
` Alt 96
a Alt 97
b Alt 98
c Alt 99
d Alt 100
e Alt 101
f Alt 102
g Alt 103
h Alt 104
i Alt 105
j Alt 106
k Alt 107
l Alt 108
m Alt 109
n Alt 110
o Alt 111
p Alt 112
Character Sequence
q Alt 113
r Alt 114
s Alt 115
t Alt 116
u Alt 117
v Alt 118
w Alt 119
x Alt 120
y Alt 121
z Alt 122
{ Alt 123
| Alt 124
} Alt 125
~ Alt 126
 Alt 127
Ç Alt 128
ü Alt 129
é Alt 130
â Alt 131
ä Alt 132
à Alt 133
å Alt 134
ç Alt 135
ê Alt 136
ë Alt 137
è Alt 138
ï Alt 139
î Alt 140
ì Alt 141
æ Alt 145
Æ Alt 146
ô Alt 147
ö Alt 148
ò Alt 149
û Alt 150
ù Alt 151
ÿ Alt 152
¢ Alt 155
£ Alt 156
¥ Alt 157
P Alt 158
ƒ Alt 159
á Alt 160
í Alt 161
Character Sequence
ó Alt 162
ú Alt 163
ñ Alt 164
Ñ Alt 165
Alt 166
Alt 167
¿ Alt 168
¬ Alt 170
½ Alt 171
¼ Alt 172
¡ Alt 173
« Alt 174
» Alt 175
¦ Alt 179
ß Alt 225
µ Alt 230
± Alt 241
° Alt 248
Alt 249
· Alt 250
² Alt 253
Alt 0128
Alt 0132
Alt 0133
Alt 0134
Alt 0135
ˆ Alt 0136
Alt 0137
Š Alt 0138
Alt 0139
Œ Alt 0140
Alt 0145
Alt 0146
Alt 0147
Alt 0148
Alt 0150
Alt 0151
˜ Alt 0152
Alt 0153
š Alt 0154
Alt 0155
œ Alt 0156
Ÿ Alt 0159
¨ Alt 0168
Character Sequence
© Alt 0169
® Alt 0174
¯ Alt 0175
³ Alt 0179
´ Alt 0180
¸ Alt 0184
¹ Alt 0185
¾ Alt 0190
À Alt 0192
Á Alt 0193
 Alt 0194
à Alt 0195
Ä Alt 0196
Å Alt 0197
È Alt 0200
É Alt 0201
Ê Alt 0202
Ë Alt 0203
Ì Alt 0204
Í Alt 0205
Î Alt 0206
Ï Alt 0207
Ð Alt 0208
Ò Alt 0210
Ó Alt 0211
Ô Alt 0212
Õ Alt 0213
Ö Alt 0214
× Alt 0215
Ø Alt 0216
Ù Alt 0217
Ú Alt 0218
Û Alt 0219
Ü Alt 0220
Ý Alt 0221
Þ Alt 0222
ã Alt 0227
ð Alt 0240
õ Alt 0245
÷ Alt 0247
ø Alt 0248
ü Alt 0252
ý Alt 0253
þ Alt 0254