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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

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


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


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.




                .terminal {
    --size: 1.5;


                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 = ansi.meta(buff);
        var cols = 80;
        if (meta) {
            buff = buff.slice(0, meta.fileSize);
            cols = meta.tInfo[0]
        var str = iconv.decode(buff, 'CP437');
        // correction for jQuery Terminal <= 2.18.3
        str = str.replace(/\x00/g, ' ').replace(/\x0F/g, '*');
        // remove code that move cursor after new line - hope this works
        str = str.replace(/[\r\n]{1,2}\x1b\[A\x1b\[[0-9]+C/g, '');
        str = $.terminal.apply_formatters(str, {
            unixFormatting: {
                escapeBrackets: true,
                ansiArt: true
        var lines = $.terminal.split_equal(str, cols);
        // unix formatting don't handle \r\n at the end
        if (lines[lines.length - 1] === '') {
        term.echo(lines.join('\n'), {
            ansi: true

    var term = $('body').terminal({
        help: function() {
                'use [[;#fff;]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 [[;#fff;]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(255,255,255,0.99);]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');