Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"exit" on console #68

Open
iynehz opened this issue Jan 22, 2017 · 1 comment
Open

"exit" on console #68

iynehz opened this issue Jan 22, 2017 · 1 comment

Comments

@iynehz
Copy link
Contributor

iynehz commented Jan 22, 2017

The ipython console, on entering "exit" or "quit", would quit the jupyter console. For present iperl, it seems only Ctrl+D works perfectly. Entering "exit" also works but in a different way: it's executed as the Perl function, and exits the process. But this causes an ugly error message like below

In [1]: exit

In [1]: /usr/lib/python3.6/site-packages/jupyter_console/ptshell.py:571: UserWarning: The kernel did not respond to an is_complete_request. Setting `use_kernel_is_complete` to False.
  warn('The kernel did not respond to an is_complete_request. '
In [1]: 

In [1]:                                                                                                                                                                                                                                       
Traceback (most recent call last):
  File "/usr/bin/jupyter-console", line 5, in <module>
    app.main()
  File "/usr/lib/python3.6/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/lib/python3.6/site-packages/jupyter_console/app.py", line 151, in start
    self.shell.mainloop()
  File "/usr/lib/python3.6/site-packages/jupyter_console/ptshell.py", line 463, in mainloop
    self.interact()
  File "/usr/lib/python3.6/site-packages/jupyter_console/ptshell.py", line 448, in interact
    code = self.prompt_for_code()
  File "/usr/lib/python3.6/site-packages/jupyter_console/ptshell.py", line 408, in prompt_for_code
    reset_current_buffer=True)
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/interface.py", line 394, in run
    self.eventloop.run(self.input, self.create_eventloop_callbacks())
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/eventloop/posix.py", line 164, in run
    t()
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/eventloop/posix.py", line 83, in read_from_stdin
    inputstream.feed(data)
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/terminal/vt100_input.py", line 395, in feed
    self._input_parser.send(c)
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/terminal/vt100_input.py", line 304, in _input_parser_generator
    self._call_handler(match, prefix)
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/terminal/vt100_input.py", line 337, in _call_handler
    self.feed_key_callback(KeyPress(key, insert_text))
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/interface.py", line 1023, in feed_key
    cli.input_processor.process_keys()
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/key_binding/input_processor.py", line 201, in process_keys
    self._process_coroutine.send(key_press)
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/key_binding/input_processor.py", line 158, in _process
    self._call_handler(matches[-1], key_sequence=buffer)
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/key_binding/input_processor.py", line 228, in _call_handler
    handler.call(event)
  File "/usr/lib/python3.6/site-packages/prompt_toolkit/key_binding/registry.py", line 31, in call
    return self.handler(event)
  File "/usr/lib/python3.6/site-packages/jupyter_console/ptshell.py", line 342, in _
    more, indent = self.check_complete(d.text)
  File "/usr/lib/python3.6/site-packages/jupyter_console/ptshell.py", line 426, in check_complete
    more = (code.splitlines()[-1] != "")
IndexError: list index out of range
@iynehz
Copy link
Contributor Author

iynehz commented Jan 22, 2017

And I just saw this http://jupyter-client.readthedocs.io/en/latest/messaging.html#payloads-deprecated

So there is some feature in Jupyter that allows kernel to ask for frontend exit. But it's deprecated without replacement... We can revisit this issue later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant