--- PseudoTerminal.m 2003/10/30 06:16:36 1.1 +++ PseudoTerminal.m 2003/10/30 06:59:07 @@ -1281,14 +1281,32 @@ if (modflag & NSControlKeyMask && send_strlen == 1 && send_str[0] == 0x7c) { send_str = "\034"; send_strlen = 1; } #endif + + // True VT100 control-key emulation + if (modflag & NSControlKeyMask && send_strlen == 1) { + switch (send_str[0]) { + case 0x33: // Control-3 -> Escape + send_str = "\033"; + break; + case 0x34: // Control-4 -> Control-\ + send_str = "\034"; + break; + case 0x37: // Control-7 -> Control-_ + send_str = "\037"; + break; + case 0x38: // Control-8 -> Delete + send_str = "\177"; + break; + } + } #if NUMERICPAD_ENTER_SUPPORT if (modflag & NSNumericPadKeyMask && send_strlen == 1 && send_str[0] == 0x03) { send_str = "\012"; // NumericPad Entry -> 0x0a