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.
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.
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 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:
(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:
If Backspace is chosen but is not the host's destructive backspace character,it is likely to:
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:
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.
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 ]
The Kermit FAQ / The Kermit Project / Columbia University / kermit@columbia.edu / 27 Apr 2001
|
|
|
|
|