jupyter / qtconsole

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

Unexpected behavior of Enter inside a code block. #314

Closed gepcel closed 6 years ago

gepcel commented 6 years ago

I don't know how to name this issue, trying to describe it by an example. If I want to input a code like the following:

for i in range(3):
    a = i + 1
    print(a)

The code would be stopped and executed immediately when hit Enter after a = i + 1. It used to be like needing to hit Enter twice after print(a).

I'm using Windows 10, and the packages I'm using:

``` C:\Users\way>conda list # packages in environment at C:\anaconda3: # # Name Version Build Channel _r-mutex 1.0.0 mro_2 adjustText 0.7.3 affine 2.2.1 py36_0 alabaster 0.7.12 py_0 anaconda custom py36h363777c_0 anaconda-client 1.7.2 py36_0 anaconda-navigator 1.9.2 py36_0 anaconda-project 0.8.2 py36_0 appdirs 1.4.3 py36h28b3542_0 asn1crypto 0.24.0 py36_0 astroid 2.0.4 py36_0 astropy 3.0.4 py36hfa6e2cd_0 atomicwrites 1.2.1 py36_0 attrs 18.2.0 py36h28b3542_0 automat 0.7.0 py36_0 autopep8 1.3.4 autopep8 1.4 py36_0 babel 2.6.0 py36_0 backcall 0.1.0 py36_0 backports 1.0 py36_1 backports.csv 1.0.5 backports.functools_lru_cache 1.5 py_1 backports.shutil_get_terminal_size 1.0.0 py36_2 baidu-aip 2.2.2.0 beautifulsoup4 4.6.3 py36_0 bitarray 0.8.3 py36hfa6e2cd_0 bkcharts 0.2 py36h7e685f7_0 blas 1.0 mkl blaze 0.11.3 py36_0 bleach 2.1.2 bleach 3.0.0 py_0 blosc 1.14.4 he51fdeb_0 bokeh 1.0.1 py36_0 boost 1.68.0 py36hf75dd32_0 boost-cpp 1.68.0 h6a4c333_1000 boto 2.49.0 py36_0 boto3 1.9.17 py_0 botocore 1.12.18 py_0 bottleneck 1.2.1 py36h452e1ab_1 bzip2 1.0.6 hfa6e2cd_5 ca-certificates 2018.10.15 ha4d7672_0 cachecontrol 0.12.5 py36_0 cairo 1.14.12 hf171d8a_3 cartopy 0.16.0 py36hbd42bde_0 certifi 2018.10.15 py36_0 cffi 1.11.5 py36h74b6da3_1 cftime 1.0.1 py36h452e1ab_1 chardet 3.0.4 py36_1 click 7.0 py36_0 click-plugins 1.0.4 py_0 cligj 0.5.0 py_0 cloudpickle 0.5.6 py36_0 clyent 1.2.2 py36_1 colorama 0.3.9 py36h029ae33_0 coloredlogs 10.0 py36_0 colorspacious 1.1.2 comtypes 1.1.7 py36_0 conda 4.5.11 py36_0 conda-env 2.6.0 1 conda-verify 3.1.1 py36_0 console_shortcut 0.1.1 3 constantly 15.1.0 py36h28b3542_0 contextily 0.99.0 contextily 1.0rc1 py_0 contextlib2 0.5.5 py36he5d52c0_0 cryptography 2.3.1 py36h74b6da3_0 curl 7.61.1 h7602738_0 cycler 0.10.0 py36h009560c_0 cython 0.29 py36ha925a31_0 cytoolz 0.9.0.1 py36hfa6e2cd_1 dask 0.15.2 py36_0 dask-core 0.19.3 py_0 datashape 0.5.4 py36_1 decorator 4.2.1 decorator 4.3.0 py36_0 descartes 1.1.0 descartes 1.1.0 py36_0 distlib 0.2.7 py36_0 distributed 1.23.3 py36_0 docutils 0.14 py36h6012d8f_0 elasticsearch 2.3.0 entrypoints 0.2.3 py36_2 et_xmlfile 1.0.1 py36h3d2d736_0 expat 2.2.5 he025d50_0 fastcache 1.0.2 py36hfa6e2cd_2 ffmpeg 4.0.2 h8fefcd1_1 filelock 3.0.8 py36_0 Fiona 1.7.13 fiona 1.8a3 py36h2fc6367_0 flashtext 2.7 flask 1.0.2 py36_1 flask-cors 3.0.6 py36_0 freetype 2.9.1 ha9979f8_1 freexl 1.0.5 hfa6e2cd_0 future 0.16.0 py36_2 future 0.16.0 GDAL 2.2.4 GDAL 2.2.3 gdal 2.2.4 py36h01e27f7_9 geographiclib 1.49 py_0 geopandas 0.4.0 py_1 geopandas 0+unknown geoplot 0.2.0 1 geopy 1.11.0 geopy 1.17.0 py_0 geos 3.6.2 h9ef7328_2 geotiff 1.4.2 hd5bfa41_0 get_terminal_size 1.0.0 h38e98db_0 gevent 1.3.6 py36hfa6e2cd_0 git 2.19.1 h21ff451_0 graphviz 2.38 hfd603c8_2 greenlet 0.4.15 py36hfa6e2cd_0 h5netcdf 0.6.2 py_0 h5py 2.8.0 py36h3bdd7fb_2 hdf4 4.2.13 h712560f_2 hdf5 1.10.2 hac2f561_1 heapdict 1.0.0 py36_2 html5lib 1.0.1 py36_0 humanfriendly 4.16.1 py36_0 hyperlink 18.0.0 py36_0 icc_rt 2017.0.4 h97af966_0 icu 58.2 ha66f8fd_1 idna 2.7 py36_0 image-match 1.1.2 imageio 2.4.1 py36_0 imagesize 1.1.0 py36_0 incremental 17.5.0 py36_0 intel-openmp 2019.0 118 ipykernel 4.8.0 ipykernel 5.1.0 py36h39e3cac_0 ipython 7.1.1 py36h39e3cac_0 ipython_genutils 0.2.0 py36h3c5d0ee_0 ipywidgets 7.4.2 py36_0 isort 4.3.4 py36_0 itsdangerous 0.24 py36_1 jdcal 1.4 py36_0 jedi 0.12.1 py36_0 jedi 0.11.1 Jinja2 2.10 jinja2 2.10 py36_0 jmespath 0.9.3 py36_0 jpeg 9c hfa6e2cd_1001 json-rpc 1.11.1 py_0 jsonschema 2.6.0 py36h7636477_0 jupyter 1.0.0 py36_7 jupyter_client 5.2.3 py36_0 jupyter_console 6.0.0 py36_0 jupyter_core 4.4.0 py36_0 jupyterlab 0.31.5 jupyterlab 0.35.4 py36_0 jupyterlab-github 0.5.0 jupyterlab-latex 0.3.1 jupyterlab-launcher 0.10.3 jupyterlab_server 0.2.0 py36_0 jupytext 0.7.1 kealib 1.4.9 h4380d0d_2 keyring 15.1.0 py36_0 kiwisolver 1.0.1 py36h6538335_0 krb5 1.16.1 h038dc86_6 lazy-object-proxy 1.3.1 py36hfa6e2cd_2 libboost 1.67.0 hd9e427e_4 libcurl 7.61.1 h7602738_0 libgdal 2.2.4 h9f8b273_9 libiconv 1.15 h1df5818_7 libkml 1.3.0 he5f2a48_4 libnetcdf 4.6.1 h70ac11d_1 libpng 1.6.35 h7602738_1002 libpq 10.5 h5fe2233_0 libsodium 1.0.16 h9d3ae62_0 libspatialindex 1.8.5 h6538335_2 libspatialite 4.3.0a h383548d_18 libssh2 1.8.0 hd619d38_4 libtiff 4.0.9 h36446d0_2 libxml2 2.9.8 hadb2253_1 libxslt 1.1.32 hf6f1972_0 llvmlite 0.25.0 py36_0 locket 0.2.0 py36hfed976d_1 lockfile 0.12.2 py36h0468280_0 lxml 4.2.5 py36hef2cd61_0 lzo 2.10 h6df0209_2 m2w64-bwidget 1.9.10 2 m2w64-bzip2 1.0.6 6 m2w64-expat 2.1.1 2 m2w64-fftw 3.3.4 6 m2w64-flac 1.3.1 3 m2w64-gcc-libgfortran 5.3.0 6 m2w64-gcc-libs 5.3.0 7 m2w64-gcc-libs-core 5.3.0 7 m2w64-gettext 0.19.7 2 m2w64-gmp 6.1.0 2 m2w64-gsl 2.1 2 m2w64-libiconv 1.14 6 m2w64-libjpeg-turbo 1.4.2 3 m2w64-libogg 1.3.2 3 m2w64-libpng 1.6.21 2 m2w64-libsndfile 1.0.26 2 m2w64-libtiff 4.0.6 2 m2w64-libvorbis 1.3.5 2 m2w64-libwinpthread-git 5.0.0.4634.697f757 2 m2w64-libxml2 2.9.3 4 m2w64-mpfr 3.1.4 4 m2w64-pcre 8.38 2 m2w64-speex 1.2rc2 3 m2w64-speexdsp 1.2rc3 3 m2w64-tcl 8.6.5 3 m2w64-tk 8.6.5 3 m2w64-tktable 2.10 5 m2w64-wineditline 2.101 5 m2w64-xz 5.2.2 2 m2w64-zlib 1.2.8 10 markupsafe 1.0 py36hfa6e2cd_1 matplotlib 3.0.0 matplotlib 3.0.1 py36hc8f65d3_0 mccabe 0.6.1 py36_1 menuinst 1.4.14 py36hfa6e2cd_0 mercantile 1.0.4 py_0 mistune 0.8.3 mistune 0.8.3 py36hfa6e2cd_1 mizani 0.5.2 py_0 mkl 2019.0 118 mkl-service 1.1.2 py36hb217b18_5 mkl_fft 1.0.6 py36hdbbee80_0 mkl_random 1.0.1 py36h77b88f5_1 mock 2.0.0 more-itertools 4.3.0 py36_0 moviepy 0.2.3.2 mplcairo 0.1.post28+g9efa978 mpld3 0.3 py36_0 mpmath 1.0.0 py36_2 msgpack-python 0.5.6 py36he980bc4_1 msys2-conda-epoch 20160418 1 multipledispatch 0.6.0 py36_0 munch 2.3.2 py36_0 navigator-updater 0.2.1 py36_0 nbconvert 5.3.1 py36_0 nbformat 4.4.0 py36h3a5bc1b_0 netcdf4 1.4.1 py36hbfe741f_0 NetEase-MusicBox 0.2.5.3 networkx 2.2 py36_1 nltk 3.3.0 py36_0 nodejs 10.13.0 0 nose 1.3.7 py36_2 notebook 5.7.0 py36_0 numba 0.40.0 py36hf9181ef_0 numexpr 2.6.8 py36h9ef55f4_0 numpy 1.15.2 py36ha559c80_0 numpy-base 1.15.2 py36h8128ebf_0 numpydoc 0.8.0 py36_0 oauthlib 2.0.6 odo 0.5.1 py36h7560279_0 olefile 0.46 py36_0 openjpeg 2.3.0 h5ec785f_1 openpyxl 2.5.8 py36_0 openssl 1.0.2p hfa6e2cd_0 owslib 0.17.0 py_0 packaging 18.0 py36_0 palettable 3.1.1 py_0 pandas 0.23.4 py36h830ac7b_0 pandoc 2.3.1 0 pandoc-eqnos 1.3.0 pandoc-fignos 1.3.0 pandoc-latex-admonition 1.2.2 pandoc-tablenos 1.3.0 pandocfilters 1.4.2 py36_1 panflute 1.10.6 parso 0.1.1 parso 0.3.1 py36_0 partd 0.3.8 py36hc8e763b_0 patsy 0.5.0 py36_0 pbr 4.0.4 pcre 8.42 hd6b2f15_0 pep8 1.7.1 py36_0 pexpect 4.6.0 py36_0 pickleshare 0.7.5 py36_0 pillow 5.3.0 py36hdc69c19_0 Pillow 5.1.0 pip 18.0 pip 18.1 py36_1000 pip 10.0.0 pixman 0.34.0 hcef7cb0_3 pkginfo 1.4.2 py36_1 plotnine 0.5.1 py_0 pluggy 0.7.1 py36h28b3542_0 ply 3.11 py36_0 plydata 0.3.2 postgresql 10.5 h5fe2233_0 progress 1.4 py36_0 proj4 4.9.3 hcf24537_7 prometheus_client 0.4.0 py_0 prompt_toolkit 2.0.5 py36_0 psutil 5.4.7 psutil 5.4.7 py36hfa6e2cd_0 psycopg2 2.7.5 py36h74b6da3_0 py 1.7.0 py36_0 pyasn1 0.4.4 py36h28b3542_0 pyasn1-modules 0.2.2 py36_0 pybind11 2.2.4 pycairo 1.18.0 py36h63da52a_0 pycodestyle 2.4.0 py36_0 pycosat 0.6.3 py36hfa6e2cd_0 pycparser 2.19 py36_0 pycrypto 2.6.1 py36hfa6e2cd_9 pycryptodomex 3.6.1 pycurl 7.43.0.2 py36h74b6da3_0 pydocstyle 3.0.0 py36_0 pyepsg 0.3.2 py36_0 pyflakes 2.0.0 py36_0 pyftpdlib 1.5.4 py_1 pygame 1.9.3 pygments 2.2.0 py36hb010967_0 pyhamcrest 1.9.0 py_2 pylint 2.1.1 py36_0 PyMuPDF 1.12.5 pyodbc 4.0.24 py36h6538335_0 pyopenssl 18.0.0 py36_0 pypandoc 1.4 pyparsing 2.2.2 py_0 pypdf2 1.26.0 py36_1 pyproj 1.9.5.1 py36haf3c679_5 pyqt 5.9.2 py36h6538335_2 PySAL 1.14.3 pysal 1.14.4.post2 py36_1 pyshp 1.2.12 py36_0 pysocks 1.6.8 py36_0 pytables 3.4.4 py36he6f6034_0 pytest 3.8.2 py36_1000 pytest-arraydiff 0.2 py36h39e3cac_0 pytest-astropy 0.4.0 py36_0 pytest-doctestplus 0.1.3 py36_0 pytest-openfiles 0.3.0 py36_0 pytest-remotedata 0.3.0 py36_0 python 3.6.7 h33f27b4_1 python-dateutil 2.7.3 py36_0 python-frontmatter 0.4.2 python-jsonrpc-server 0.0.2 py_0 python-language-server 0.19.0 py36_0 python-slugify 1.2.5 PythonMagick 0.9.13 pythonnet 2.3.0 PyTumblr 0.0.7 pytz 2018.5 py36_0 pywavelets 1.0.1 py36h8c2d366_0 pywin32 224 py36hfa6e2cd_1000 pywin32-ctypes 0.2.0 py36_1000 pywinpty 0.5.4 py36_0 pyyaml 3.13 py36hfa6e2cd_0 pyzmq 17.1.2 py36hfa6e2cd_0 pyzmq 16.0.4 QDarkStyle 2.5.4 qt 5.9.6 vc14h1e9a669_2 qtawesome 0.5.2 py36_0 qtconsole 4.4.2 py36_0 qtpy 1.5.2 py36_0 rasterio 1.0.8 py36hfa10f2d_0 rasterio 1.0.5 requests 2.20.0 py36_1000 requests-cache 0.4.13 requests-oauthlib 0.8.0 rise 5.2.0 rope 0.10.7 py36_0 rpy2 2.9.4 rtree 0.8.3 py36_0 ruamel_yaml 0.15.71 py36hfa6e2cd_1000 s3transfer 0.1.13 py36_0 scikit-image 0.14.1 py36h6538335_0 scikit-image 0.12.3 scikit-learn 0.20.0 py36heebcf9a_1 scikit-misc 0.1.1 scipy 1.1.0 py36h4f6bf74_1 seaborn 0.9.0 py36_0 selenium 3.14.1 py36hfa6e2cd_0 send2trash 1.5.0 py36_0 service_identity 17.0.0 py36h28b3542_0 setuptools 38.5.1 setuptools 40.4.3 py36_0 shapely 1.6.4 py36hc90234e_0 shutilwhich 1.1.0 simplegeneric 0.8.1 py36_2 singledispatch 3.4.0.3 py36h17d0c80_0 sip 4.19.8 py36h6538335_0 six 1.11.0 py36_1 snappy 1.1.7 h777316e_3 snowballstemmer 1.2.1 py36h763602f_0 snuggs 1.4.2 py36_0 sortedcollections 1.0.1 py36_0 sortedcontainers 2.0.5 py36_0 sphinx 1.8.1 py36_0 sphinx-gallery 0.2.0 sphinx-rtd-theme 0.4.1 sphinxcontrib 1.0 py36_1 sphinxcontrib-websupport 1.1.0 py36_1 spyder 4.0.0.dev0 spyder-kernels 1.1.0 py_0 sqlalchemy 1.2.12 py36he774522_0 sqlite 3.25.2 hfa6e2cd_0 statsmodels 0.9.0 py36h452e1ab_0 sympy 1.3 py36_0 tblib 1.3.2 py36h30f5020_0 terminado 0.8.1 py36_1 testfixtures 6.3.0 testpath 0.4.2 py36_0 tk 8.6.8 hfa6e2cd_0 tomd 0.1.3 toolz 0.9.0 py36_0 tornado 4.5.3 py36_0 tornado 4.5.3 tqdm 4.19.5 tqdm 4.28.1 py36h28b3542_0 traitlets 4.3.2 py36h096827d_0 traittypes 0.2.1 py_1 twisted 18.7.0 py36hfa6e2cd_1 typed-ast 1.1.0 py36hfa6e2cd_0 typing 3.6.4 py36_0 tzlocal 1.5.1 py36_0 unicodecsv 0.14.1 py36h6450c06_0 Unidecode 1.0.22 urllib3 1.23 py36_0 vc 14.1 h0510ff6_3 vs2015_runtime 15.5.2 3 Wand 0.4.4 wcwidth 0.1.7 py36h3d5aa90_0 webencodings 0.5.1 py36_1 werkzeug 0.14.1 py36_0 wget 3.2 wheel 0.32.1 py36_0 widgetsnbextension 3.4.2 py36_0 win_inet_pton 1.0.1 py36_1 win_unicode_console 0.5 py36hcdbd4b5_0 wincertstore 0.2 py36h7fe50ca_0 windows-curses 1.0 winpty 0.4.3 4 wrapt 1.10.11 py36hfa6e2cd_2 xarray 0.10.9 py36_0 xerces-c 3.2.0 h44c76bb_2 xlrd 1.1.0 py36_1 xlsxwriter 1.1.2 py36_0 xlwings 0.11.8 py36_0 xlwt 1.3.0 py36h1a4751e_0 xz 5.2.4 h2fa13f4_4 yaml 0.1.7 hc54c509_2 yapf 0.24.0 py36_0 you-get 0.4.1128 youtube-dl 2018.11.3 py36_1000 youtube-dl 2018.2.4 zeromq 4.2.5 he025d50_1 zict 0.1.3 py36_0 zlib 1.2.11 h8395fce_2 zope 1.0 py36_1 zope.interface 4.5.0 py36hfa6e2cd_0 ```
mamrhein commented 6 years ago

Work around: press ctrl-enter to get a new line.

mamrhein commented 6 years ago

A similar bug was detected in the IPython terminal. It seems to be fixed there. See 11358.

ccordoba12 commented 6 years ago

Thanks for reporting. I'm preparing a new release (4.4.3) to fix this.