diff --git a/IPython/html/static/notebook/js/notificationarea.js b/IPython/html/static/notebook/js/notificationarea.js index 75dba95a0..bfd15d5ba 100644 --- a/IPython/html/static/notebook/js/notificationarea.js +++ b/IPython/html/static/notebook/js/notificationarea.js @@ -188,28 +188,35 @@ define([ var full = status.responseJSON.message; var short = status.responseJSON.short_message || 'Kernel error'; var traceback = status.responseJSON.traceback; - var msg = $('
'); - - msg.append($('').text(full)); - if (traceback) { - msg.append($('') - .attr('rows', '13') - .attr('cols', '80') - .attr('readonly', 'true') - .css('margin-top', '1em') - .text(traceback)); - } var showMsg = function () { + var msg = $('').append($('').text(full)); + var cm, cm_elem; + + if (traceback) { + cm_elem = $('') + .css('margin-top', '1em') + .css('padding', '1em') + .addClass('output_scroll'); + msg.append(cm_elem); + cm = CodeMirror(cm_elem.get(0), { + mode: "python", + readOnly : true + }); + cm.setValue(traceback); + } + dialog.modal({ title: "Failed to start the kernel", body : msg, keyboard_manager: that.keyboard_manager, notebook: that.notebook, + open: $.proxy(cm.refresh, cm), buttons : { "Ok": { class: 'btn-primary' } } }); + return false; };