Multi-line input only processes the first line
See original GitHub issueWith 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:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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
andrlwrap
makes it usable again, but disables all the useful tab completion.