Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.




 * fix for buggy Windows 7
 * handling of small font size
.terminal {
    --size: 1.5;
    --color: rgba(255,255,255,0.99);
for IE:
.terminal, .terminal-output > :not(.raw) span, .terminal-output > :not(.raw) a, .terminal-output > :not(.raw) div, .cmd, .cmd span, .cmd div {
    font-size: 14px;
    line-height: 16px;


                var url = ''; // CORS enabled

(async function() {
    function get(url) {
        return fetch(url).then(res => res.text()).then(text=>text.trim());
    var files = (await get(url + '?action=ls')).split('\n');
    function get_ansi(name) {
        return fetch(url + '?raw=1&file=' + name).
            then(res => res.arrayBuffer()).then(a => new Uint8Array(a));
    function echo_ansi(buff) {
        var meta = AnsiLove.sauceBytes(buff);
        var cols = 80;
        if (meta) {
            buff = buff.slice(0, meta.fileSize);
            cols = meta.tInfo1;
        var str = iconv.decode(buff, 'CP437');
        // remove code that move cursor after new line - hope this works
        str = str.replace(/\r?\n?\x1b\[A\x1b\[[0-9]+C/g, '');
        str = $.terminal.apply_formatters(str, {});
        var lines = $.terminal.split_equal(str, cols);
        // unix formatting don't handle \r\n at the end
        if (lines[lines.length - 1] === '') {
        // one flush to output whole image to the screen => term.echo(line, {flush: false}));

    var term = $('body').terminal({
        help: function() {
                'use [[;#888;]ls] to display list of files and [[;#888;]cat]',
                ' to display the artwork, you can also [[u;;]drag and drop] the file.',
                '\nOnly Code Page 437 encoding files will work (classic demo s',
                'cene files).\nType [[;#888;]credits] to show credits for ANSI',
                ' Art works. Use tab so you don\'t need to type whole filename.',
                '\nType [[;#888;]clear] to clear terminal.'
            ].join(''), {keepWords: true});
        cat: function(name) {
        size: function(size) {
            if (typeof size === 'number') {
                term.css('--size', size);
        ls: function() {
        credits: function() {
            this.echo('ANSI artworks taken from [[!;;;;]16colors]')
    }, {
        completion: function(string, callback) {
            if (this.get_command().match(/^cat /)) {
            } else {
                callback(['ls', 'file', 'credits', 'help']);
        outputLimit: 250,
        greetings: 'ANSI ART Terminal viewer\nType [[;rgba(125,125,125,0.9);]help] for more info\n',
        name: 'ansi'
    }).drop(function(array_buff) { // drop plugin
        echo_ansi(new Uint8Array(array_buff));
        return'press enter to continue ');
    }, {
        type: 'arraybuffer',
        error: function(e) {
        complete: function() {
            term.echo('all files rendered');