diff --git a/core/src/main/resources/hudson/tasks/Shell/config.groovy b/core/src/main/resources/hudson/tasks/Shell/config.groovy index c608e2469cc5..3e81fb53d44e 100644 --- a/core/src/main/resources/hudson/tasks/Shell/config.groovy +++ b/core/src/main/resources/hudson/tasks/Shell/config.groovy @@ -25,6 +25,5 @@ package hudson.tasks.Shell; f=namespace(lib.FormTagLib) f.entry(title:_("Command"),description:_("description",rootURL)) { - // TODO JENKINS-23151 'codemirror-mode': 'shell' is broken - f.textarea(name: "command", value: instance?.command, class: "fixed-width") + f.textarea(name: "command", value: instance?.command, class: "fixed-width", 'codemirror-mode': 'shell', 'codemirror-config': "mode: 'text/x-sh'") } diff --git a/core/src/main/resources/lib/form/textarea/textarea.js b/core/src/main/resources/lib/form/textarea/textarea.js index 4b07cd7caac8..f1c1b2238fe8 100644 --- a/core/src/main/resources/lib/form/textarea/textarea.js +++ b/core/src/main/resources/lib/form/textarea/textarea.js @@ -10,7 +10,8 @@ Behaviour.specify("TEXTAREA.codemirror", 'textarea', 0, function(e) { } var h = e.clientHeight || getTextareaHeight(); - var config = e.getAttribute("codemirror-config") || ""; + var config = e.getAttribute("codemirror-config"); + config += (config ? ", " : " ") + "onBlur: function(editor){editor.save()}"; config = eval('({'+config+'})'); var codemirror = CodeMirror.fromTextArea(e,config); e.codemirrorObject = codemirror;