question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IPython 5.3 terminal: enter should execute not insert line break

See original GitHub issue

This is a regression from 5.2.2 to 5.3 when using the terminal interface: if the cursor is in the middle of a line and I press enter, a line break is inserted into the line. On 5.2.2, pressing enter had the same effect as if the cursor was at the end of the line i.e. it executes the line I’ve just entered.

To reproduce: type foo(2, 3) (without pressing enter), move the cursor to be on the 3, then press enter.

It’s extremely rare that one wants to break lines in an interactive session, but quite common to go back to a line from history, modify the contents, and then immediately want to execute it. Please bring back the old behaviour.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:22
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

14reactions
Carreaucommented, Apr 6, 2017

If reverting it completely is not possible, would it work to have Shift+Enter to execute (as in notebooks) when in the middle of a line?

Unfortunately terminals technical limitation prevent us to do that. You can use Esc followed by Enter though.

3reactions
iblislincommented, Apr 26, 2017

Is there any way to configure this behavior? I expect the command should be executed instantly as well…

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Adding line breaks in ipython - Stack Overflow
Been suffering this problem for a while. I just found that when using Ctrl-q Ctrl-j (That's lowercase Q, J, no need to hold...
Read more >
5.x Series — IPython 8.7.0 documentation
IPython should start faster, as it no longer looks for all available ... line would be executed when enter is pressed, IPython 5.x...
Read more >
Markdown for Jupyter notebooks cheatsheet - IBM
Here's how to format Markdown cells in Jupyter notebooks: Headings: Use the number sign (#) followed by a blank space for notebook titles...
Read more >
IPython newlines with ^V^J (Example) - Coderwall
If you're having trouble adding newlines in the middle of a multiline code block in IPython, try using Ctrl-V Ctrl-J to insert a...
Read more >
Jupyter Notebook Users Manual.ipynb - Bryn Mawr College
By default, Jupyter Notebooks' Code Cells will execute Python. ... In a hard-wrapped paragraph the line breaks are not dependent on the size...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found