xterm.4.0编写的一个示例代码

代码语言:html

所属分类:其他

代码描述:xterm.4.0编写的一个示例代码,官方增加了runFakeTerminal

代码标签: 一个 示例

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>BFW NEW PAGE</title>
    <script id="bfwone" type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/bfwone.js"></script>
    <script type="text/javascript">
        bready(function() {
            use(["xterm.4.0", "xterm.4.0"], function() {

                // HACK: This should be window.Terminal once upgraded to 4.0.1
                var term = new window.Terminal.Terminal();
                term.open(document.getElementById('terminal'));

                function runFakeTerminal() {
                    if (term._initialized) {
                        return;
                    }

                    term._initialized = true;

                    term.prompt = () => {
                        term.write('\r\n$ ');
                    };

                    term.writeln('Welcome to xterm.js');
                    term.writeln('This is a local terminal emulation, without a real terminal in the back-end.');
                    term.writeln('Type some keys and commands to play around.');
                    term.writeln('');
            .........完整代码请登录后点击上方下载按钮下载查看

网友评论0