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.

Multi-line input only processes the first line

See original GitHub issue

With ipython 5.0 and 5.1 (from anaconda) I have the issue that multiple lines of input in one batch via the tty are not processed correctly. Only the first line is evaluated. This can be verified via tmux and the send-keys feature:

Start ipython in a tmux session:

tmux new -s test ipython

And send two lines of code in one batch from another terminal:

tmux send-keys -t 'test' 'print 42' Enter 'print 44' Enter

Only the first line is evaluated.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
languitarcommented, Sep 17, 2016

My expectation would be that the unprocessed characters after the first enter are just queued up and processed once the first execution returns. This is the behavior that existed in previous versions and which I am used to from basically any other command-line based tool. Simply swallowing key presses doesn’t sound nice to me.

0reactions
markstewardcommented, Sep 9, 2018

I hit this all the time just because of ipython’s slow startup. I often find myself writing a couple of lines of code in the time it takes to load, and only the first of them is executed. --simple-prompt and rlwrap makes it usable again, but disables all the useful tab completion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get multiline input from the user - python
input does not allow the user to put lines separated by newline ( Enter ). It prints back only the first line. Can...
Read more >
Keep only the first line from every sequence of consecutive ...
Nice question. In case we have 3 or more consecutive lines matching the pattern then just keep the first line and delete the...
Read more >
Multiline techniques (sed, a stream editor)
6.3 Multiline techniques - using D,G,H,N,P to process multiple lines · The first expression, /./{H;$!d} operates on all non-empty lines, and adds the...
Read more >
Manage multiline messages | Filebeat Reference [8.5]
Specifies a regular expression, in which the current multiline will be flushed from memory, ending the multiline-message. Work only with pattern type. multiline...
Read more >
The Textarea element - HTML: HyperText Markup Language
The HTML element represents a multi-line plain-text editing control, ... whose id is specified by the form attribute of the input element.
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