ColdGrub1384 / Pisth

SSH and SFTP client for iOS
https://develobile.com/pisth
Apache License 2.0
412 stars 67 forks source link

xterm.js backspace not work in safari. #3

Closed kaich closed 6 years ago

kaich commented 6 years ago

I hava use the xterm.js. I have test the terminal.html in safari. And I add code as below:

<meta name="viewport" content="width=device-width height=device-height initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="xterm.css" />
<script src="xterm.js"></script>
<script src="fit.js"></script>

<body style="background-color: transparent;">
    <div id="terminal" style="height: 100%; width: 100%;"></div>

    <script type="text/javascript">

        var term = new Terminal();
        term.open(document.getElementById('terminal'));

        term.write('Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ')

        term.on( "key" ,function (key,e) {
            term.write(String.fromCharCode(e.keyCode));
            console.log(e)
        })
    </script>
</body>

when input a long line. when I press delete key. The cursor don't move up to first line. I want to know how do you deal with this problem. Your app is works fine. Could you help me?