cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <form>
    <label for="type">Window Type:</label>
    <select id="type">
        <option value="osx">osx</option>
        <option value="ubuntu" selected>ubuntu</option>
        <option value="windows">windows</option>
        <option value="custom">custom</option>
    </select>
    <label for="dark">dark</label>
    <input type="checkbox" id="dark" checked/>
</form>
<!-- shell.js terminal window -->
<div class="shell ubuntu dark shadow">
    <div class="status-bar">
        <div class="buttons">
            <a href="javascript:;" class="close" title="Close">
                <i class="fa fa-times"></i>
            </a>
            <a href="javascript:;" class="minimize" title="Minimize">
                <i class="fa fa-minus"></i>
                    
            </a>
            <a href="javascript:;" class="enlarge" title="Enlarge">
                <i class="fa fa-plus"></i>
                    
            </a>
                    
        </div>
        <div class="title">user@host: ~</div>
    </div>
    <div class="content"></div>
</div>

            
          
!
            
              form {
    margin: 10px;
}
body .shell {
    width: 400px;
    height: 200px;
}
.shell > .status-bar .title {
    cursor: move;
}
.shell.ubuntu .terminal {
    --background: #300924;
}
.shell.osx .content.terminal {
    --background: #222;
}
.shell.light .content.terminal {
    --background: white;
    --color: black;
}

/*
 * fix to shell.js to center title to free space
 */
.shell.windows .status-bar .title {
    right: 106px;
}
/*
 * windows and custom are the last ones so
 * they don't get overwritten by light
 */
.shell.windows .content.terminal {
    --background: black;
    --color: white;
    --animation: terminal-underline;
}
.shell.custom .content.terminal {
    --background: #292929;
    --color: #aaa;
}
/*
 * overwrite shell.js style because shell.js   
 * selectors are stronger then terminal ones
 */
.cmd span.cursor {
    animation: none;
    width: initial;
    background-color: var(--background, #000);
}
.shell terminal.content,
.shell.osx.dark .content,
.shell.ubuntu .content {
    background-color: var(--background, #222) !important;
}
            
          
!
            
              // for browsers that don't support key property
keyboardeventKeyPolyfill.polyfill();
var shell = $('.shell').resizable({
    minHeight: 108,
    minWidth: 250
}).draggable({
    handle: '> .status-bar .title'
})
var term = $('.content').terminal($.noop, {
    prompt: 'user@host:~ '
});

$('#type').on('change', function() {
    shell.removeClass('osx windows ubuntu default custom').addClass(this.value);
    var prompt;
    if (this.value == 'windows') {
        prompt = 'C:\\Windows\\>';
    } else {
        prompt = 'user@host:~ ';
    }
    term.set_prompt(prompt);
    $('.title').html(prompt);
});
$('#dark').on('change', function() {
    shell.removeClass('dark light');
    if (this.checked) {
        shell.addClass('dark');
    } else {
        shell.addClass('light');
    }
});
$('#type, #dark').on('change', function() {
    setTimeout(function() {
        term.focus();
    }, 400)
});
github('jcubic/jquery.terminal');
            
          
!
999px
Loading ..................

Console