mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
CTRL-ENTER now runs a cell in "terminal mode"
In this mode, a new cell is not created after the current cell is run. Once the cell is run, the current input is cleared, so it acts just like the terminal.
This commit is contained in:
parent
64273fa929
commit
5519c01de3
@ -228,6 +228,11 @@ var IPython = (function (IPython) {
|
||||
};
|
||||
|
||||
|
||||
CodeCell.prototype.clear_input = function () {
|
||||
this.code_mirror.setValue('');
|
||||
};
|
||||
|
||||
|
||||
CodeCell.prototype.collapse = function () {
|
||||
this.element.find('div.output').hide();
|
||||
};
|
||||
|
@ -59,6 +59,10 @@ var IPython = (function (IPython) {
|
||||
} else if (event.which === 13 && event.shiftKey) {
|
||||
that.execute_selected_cell(true);
|
||||
return false;
|
||||
} else if (event.which === 13 && event.ctrlKey) {
|
||||
that.execute_selected_cell(false);
|
||||
that.selected_cell().clear_input();
|
||||
return false;
|
||||
};
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user