Comments (18)
Ctrl+Shift+K works for me, Ctrl+K does not work on my mac.
from qtconsole.
Ctrl+K works for me on Linux and Windows. @wmvanvliet, would you like to take a look at this one for Mac?
from qtconsole.
I think this is not possible because qtconsole uses Qt widgets and features to emulate the behavior of a real console (i.e. a tty one, where readline works), but it doesn't use any of its technologies.
from qtconsole.
Hi @ccordoba12, first of all - no such thing as "impossible" :)
Now, I get how the qtconsole works and that it doesn't really uses the readline - but we can hook the readline calls, for example - if as a first challenge readline uses raw_input
which blocks the kernel - we can overwrite it and send a signal to the frontend and wait for a return, we can basically rewire our endpoints("complete_info", "execute" and the history saved by HistoryWidget) to emulate a use of readline.
What do you think?
from qtconsole.
Bumping, can we at least try to think of a way, it's possible, I'm just asking for some guidance for the best possible solution.
When the kernel is blocking in a While True
, and querying the channel for an input from the frontend, we can query the other endpoints as well, am I missing something?
from qtconsole.
I think it would be a mess to try to support readline and it's not worth the effort.
Besides, I can't provide guidance because I don't have enough knowledge of the Jupyter internals to do so ;-)
from qtconsole.
I think we shouldn't use readline in the qtconsole. The kernel produces completions entirely without readline. Readline is just one way of putting those completions into a terminal UI. Since we don't use a terminal UI, readline doesn't offer much value in the qtconsole.
from qtconsole.
what features of readline do you need? if it is just a matter of getting history and completion in pdb, then probably forcing in readline isn't the corret route...
from qtconsole.
It's not about adding value, it's about supporting the current python libs.
QtConsole is a shell, and as such should keep compatibility with the console, right now libs that use readline are broken/half-usable, IMO this is awful.
To solve this, we could either patch it, so qtconsole would behave nicely with readline, or support multiple Consoles\Kernels in a single screen(which you said once, you will never support).
What do you think? Can we try to solve this?
from qtconsole.
it's about supporting the current python libs
Which libraries?
QtConsole is a shell
Nop, qtconsole just emulates several behaviors of a terminal but it has never tried to be a complete one. That's why, for example, running
!top
doesn't work on it.
To solve this, we could either patch it, so qtconsole would behave nicely with readline
Or even simpler: just simulate whatever readline features you want to have using Qt widgets and features.
from qtconsole.
ipdb as the obvious one, just search for cli language:python
on github or readline languge:python
, and you'll find a handful.
You're right, it's not a complete terminal, but it should strive to be a complete IPython terminal!
Which means, it should try it's best to be able to run python libs.
Sounds interesting, but how is that simpler? Can you give an example?
from qtconsole.
ipdb as the obvious one
ipdb doesn't work because of a limitation of the frontend/kernel architecture, not because qtconsole lacks readline support. I think the kernel blocks once you enter pdb, and that's why you can't have history browsing and all other nice features you have in terminal IPython.
it should strive to be a complete IPython terminal!
No need of it. As I said, trying to force qtconsole to be a real terminal would be a mess. If you want a real terminal, you can just open one :-)
Sounds interesting, but how is that simpler? Can you give an example?
Please take a look at how history browsing works in qtconsole. Or how Ctrl+K
and similar shortcuts work.
Given that @minrk and me are -1 on this idea, I think you're on your own if you want to implement it, and even then it could not be merged. Sorry, but IMHO this is not something that deserves to be discussed further.
from qtconsole.
what features of readline do you need?
I am (desperately) missing control-k (kill text to end of line).
from qtconsole.
That works on qtconsole, I use it regularly :-)
from qtconsole.
I installed Anaconda a few days ago on MacOS (Sierra), and control-k doesn't work for me. Any hints how to make it work? Could it be left overs from previous installations?
EDIT: FTR, control-k is effective in the notebook and in the console, just not in the qtconsole.
Jupyter QtConsole 4.2.1
Python 2.7.12 |Anaconda 4.2.0 (x86_64)| (default, Jul 2 2016, 17:43:17)
Type "copyright", "credits" or "license" for more information.
IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
from qtconsole.
Same here, it works with shift. That's pretty weird that the key is different only for qtconsole
. I don't see how I will get used to this.
from qtconsole.
see #164
from qtconsole.
Closing this. The volunteers working on qtconsole will not add readline support anytime soon. Feel free to take a stab at it yourself if you feel up to it.
from qtconsole.
Related Issues (20)
- qtconsole packaged into .app macOS bundle using py2app
- Crash on PySide6 due to version checking HOT 1
- Catching Ctrl-Z and Ctrl-\
- Question: Removal of ipython_genutils HOT 1
- Values missing from console when running automatically
- AttributeError: 'QtInProcessChannel' object has no attribute 'closed' HOT 2
- How to access objects in my application follow the example qtconsole/examples/inprocess_qtconsole.py? HOT 2
- Qt bindings version outdated in documentation HOT 2
- Matplotlib Qt5Agg backend is given anonymous icon when used with qtconsole on macOS HOT 3
- Weird pytest error: 'CompletionHtml' object has no attribute '_text_edit' HOT 4
- Qtconsole quits when trying to drag in PyQt6 HOT 12
- Segmentation Fault on `jupyter qtconsole` HOT 10
- Stop using `IPythonLexer` from ` IPython.lib.lexers` HOT 3
- TypeError due to wrong spelling in keyword HOT 1
- compute_item_matrix() got an unexpected keyword argument 'displaywidth' HOT 1
- New tab causes crash for --existing kernels
- intersphinx warning HOT 1
- possibly removing `qtconsole` from jupyter metapackage HOT 2
- Horizontal scrolling not updated until wndow resize event HOT 3
- misspelled keyword arg in qtconsole.util.compute_item_matrix HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtconsole.