##// END OF EJS Templates
%%bash: read from stream until separator found or buffer is full (#14019)...
%%bash: read from stream until separator found or buffer is full (#14019) Original issue: https://github.com/ipython/ipython/issues/14005 TLDR before we would read line by line however this is not necessary and we should just continue reading until we reach EOF. The case we patch here is if we read a line larger than the allowed buffer size, we will return that chunk (aka the entire buffer) to be written out and still continue reading.

File last commit:

r27843:667f3cbe
r28222:47d043e1 merge
Show More
gtk3.py
14 lines | 280 B | text/x-python | PythonLexer
"""prompt_toolkit input hook for GTK 3
"""
from gi.repository import Gtk, GLib
def _main_quit(*args, **kwargs):
Gtk.main_quit()
return False
def inputhook(context):
GLib.io_add_watch(context.fileno(), GLib.PRIORITY_DEFAULT, GLib.IO_IN, _main_quit)
Gtk.main()