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

Enhance handling of input from other clients #196

Merged
merged 4 commits into from
Sep 20, 2017

Conversation

wmvanvliet
Copy link
Contributor

@wmvanvliet wmvanvliet commented Mar 20, 2017

The c.ConsoleWidget.include_other_output = True switch will make QtConsole display input given to the kernel that was initiated by other clients. For example, a text editor can connect to the kernel and allow users to select pieces of code and execute them (like the F9 button in Spyder and MATLAB).

This PR fixes some bugs and adds some enhancements when displaying "other_input" and "other_output".

  1. Adds an [remote] In [n]: prompt for other_input and an [remote] Out[n]: prompt for other_output (like jupyter-console does)
  2. Adds a configuration option other_output_prefix to change the [remote] prefix above to something else (like jupyter-console has)
  3. Fixes the syntax highlighting of other_input. The decision on whether to highlight a block is made based on whether the block starts with a prompt. The prompt detection code has been updated to properly detect the prompt generated by other_input.
  4. After other_input is received, it includes an updated prompt number. The number of the current prompt is updated in-place to reflect this.

@wmvanvliet wmvanvliet added this to the 4.4 milestone Mar 20, 2017
@wmvanvliet wmvanvliet changed the title [WIP] Enhance handling of input from other clients [MRG] Enhance handling of input from other clients Apr 6, 2017
@ccordoba12 ccordoba12 changed the title [MRG] Enhance handling of input from other clients Enhance handling of input from other clients May 3, 2017
@ccordoba12
Copy link
Collaborator

This PR gives displaying whatever text I send to the kernel, some much needed love.

What were the previous failures that this PR fixes?

@@ -494,6 +494,13 @@ def sizeHint(self):
Outputs are not displayed until enter is pressed.
"""
)

other_output_prefix = Unicode('[remote] ', config=True,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this value set to [remote]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the default used in the jupyter console client. I copied the feature from there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, didn't know that.

@wmvanvliet
Copy link
Contributor Author

I've updated the description of this PR to be more informative.

@ccordoba12 ccordoba12 merged commit bf07948 into jupyter:master Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants