fix backspace mobile ssh

This commit is contained in:
Simon Smith 2023-10-15 23:42:08 +01:00 committed by GitHub
parent d095831b6d
commit ad14c83400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2968,7 +2968,15 @@
gotKeyPressEvent = false; gotKeyPressEvent = false;
var k = 0; var k = 0;
if (e.charCode != 0) { k = e.charCode; } else if (e.keyCode != 0) { k = e.keyCode; } if (e.charCode != 0) { k = e.charCode; } else if (e.keyCode != 0) { k = e.keyCode; }
if (k == 8) { terminal.sendText(String.fromCharCode(k)); } // Enter and backspace if (k == 8) { // Enter and backspace
if (terminal.urlname == 'sshterminalrelay.ashx') {
// SSH
terminal.socket.send('~' + String.fromCharCode(k));
} else {
// Agent
terminal.sendText(String.fromCharCode(k));
}
}
else if (e.ctrlKey && (k >= 64) && (k <= 95)) { else if (e.ctrlKey && (k >= 64) && (k <= 95)) {
// Ctrl keys // Ctrl keys
if (terminal.urlname == 'sshterminalrelay.ashx') { if (terminal.urlname == 'sshterminalrelay.ashx') {