From 3980d815b3558f9730db960512d77cba9204e36a Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Wed, 4 Apr 2018 22:09:51 +0200 Subject: [PATCH] Prevent default event handling on new terminal Avoid resetting the directory navigation when you create a new terminal. Closes gh-3496 --- notebook/static/tree/js/terminallist.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/notebook/static/tree/js/terminallist.js b/notebook/static/tree/js/terminallist.js index 2f349afe2..bf95f0c99 100644 --- a/notebook/static/tree/js/terminallist.js +++ b/notebook/static/tree/js/terminallist.js @@ -42,7 +42,10 @@ define([ $('#new-terminal').click($.proxy(this.new_terminal, this)); }; - TerminalList.prototype.new_terminal = function () { + TerminalList.prototype.new_terminal = function (event) { + if (event) { + event.preventDefault(); + } var w = window.open('#', IPython._target); var base_url = this.base_url; var settings = {