jupyter / qtconsole

Jupyter Qt Console
https://qtconsole.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
418 stars 201 forks source link

Issue with executing cells when launching a Qt console from a Qt console #190

Open astrofrog opened 7 years ago

astrofrog commented 7 years ago

I am trying to launch a Qt console from an app launched from a Qt console (so to simplify, I am trying to launch a Qt console inside a Qt console). If I type:

%gui qt

from __future__ import absolute_import, division, print_function

from IPython import get_ipython
from ipykernel.connect import get_connection_file
from qtconsole.rich_jupyter_widget import RichJupyterWidget
from qtconsole.client import QtKernelClient

shell = get_ipython()

client = QtKernelClient(connection_file=get_connection_file())
client.load_connection_file()
client.start_channels()

control = RichJupyterWidget()
control.kernel_client = client
control.shell = shell

control.show()

inside a qtconsole, I get a new console, but in the new console it seems that I have to press shift-enter in that console to get cells to execute. Is there a way to make the new qtconsole behave 'normally', i.e. execute cells after pressing only enter?

Original qtconsole:

screen shot 2017-02-08 at 13 53 28

New qtconsole:

screen shot 2017-02-08 at 13 53 31
takluyver commented 7 years ago

I suspect that gets messy because the second console has its UI and its kernel in the same process, but I don't know precisely what goes wrong.