<commit_before>$(function(){
    $('#prompt').css('width', $('#terminal')[0].clientWidth);

    var Command = Backbone.Model.extend({
        defaults: function() {
            return {
                name: 'help',
                text: 'Welcome to my website.'
            };
        },
        initialize: function() {
            if (!this.get("name")) {
                this.set({"name": this.defaults().name});
            }
            if (!this.get("text")) {
                this.set({"text": this.defaults().text});
            }
        }
    });

    var Input = Backbone.Model.extend({
        defaults: function() {
            return {
                name: 'help',
                text: 'Welcome to my website.'
            };
        },
        initialize: function() {
            if (!this.get("name")) {
                this.set({"name": this.defaults().name});
            }
        }
    });

    var InputView = Backbone.View.extend({
        tagName: 'div',
        template: _.template($('#input-entered').html()),
        render: function() {
            this.$el.html(this.template(this.model.toJSON()));
            return this;
        }
    });

    var AppView = Backbone.View.extend({
        el: $("#app"),
        initialize: function() {
            this.input = this.$('#prompt');
        },
        events: {
            "keyup #prompt": "getOutput"
        },
        commands: {
            'help': 'Hello there!'
        },
        history: [],
        getOutput: function(e) {
            if (e.keyCode == 13) {
                var view;
                var inp = this.input.val();
                var command = this.commands[inp];
                if(command === undefined) {
                    view = new InputView({
                        model: new Input({
                            name: inp,
                            text: 'Command not found'
                        })
                    });
                    this.$("#terminal").append(view.render().el);
                }else{
                    view = new InputView({
                        model: new Input({
                            name: inp,
                            text: this.commands[inp]
                        })
                    });
                    this.$("#terminal").append(view.render().el);
                }
                this.history.push(inp);
                this.input.val('');
            }else if (e.keyCode == 38) {
                var lastInput = this.history.pop();
                this.input.val(lastInput);
            }<commit_msg>scrolled to last command, always<commit_after>$(function(){
    $('#prompt').css('width', $('#terminal')[0].clientWidth);

    var Command = Backbone.Model.extend({
        defaults: function() {
            return {
                name: 'help',
                text: 'Welcome to my website.'
            };
        },
        initialize: function() {
            if (!this.get("name")) {
                this.set({"name": this.defaults().name});
            }
            if (!this.get("text")) {
                this.set({"text": this.defaults().text});
            }
        }
    });

    var Input = Backbone.Model.extend({
        defaults: function() {
            return {
                name: 'help',
                text: 'Welcome to my website.'
            };
        },
        initialize: function() {
            if (!this.get("name")) {
                this.set({"name": this.defaults().name});
            }
        }
    });

    var InputView = Backbone.View.extend({
        tagName: 'div',
        template: _.template($('#input-entered').html()),
        render: function() {
            this.$el.html(this.template(this.model.toJSON()));
            return this;
        }
    });

    var AppView = Backbone.View.extend({
        el: $("#app"),
        initialize: function() {
            this.input = this.$('#prompt');
        },
        events: {
            "keyup #prompt": "getOutput"
        },
        commands: {
            'help': 'Hello there!'
        },
        history: [],
        getOutput: function(e) {
            if (e.keyCode == 13) {
                var view;
                var inp = this.input.val();
                var command = this.commands[inp];
                if(command === undefined) {
                    view = new InputView({
                        model: new Input({
                            name: inp,
                            text: 'Command not found'
                        })
                    });
                    this.$("#terminal").append(view.render().el);
                }else{
                    view = new InputView({
                        model: new Input({
                            name: inp,
                            text: this.commands[inp]
                        })
                    });
                    this.$("#terminal").append(view.render().el);
                }
                this.history.push(inp);
                this.input.val('');
            }else if (e.keyCode == 38) {
                var lastInput = this.history.pop();
                this.input.val(lastInput);
            }
            $('#terminal').scrollTop(99999);
{'fraction_non_alphanumeric': 0.1483957219251337, 'fraction_numerical': 0.0028647822765469825, 'mean_word_length': 1.0740594059405941, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7511653', 'n_tokens_mistral': 1364, 'n_tokens_neox': 1273, 'n_words': 255}