Skip to content
New issue

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

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

Already on GitHub? # to your account

IPython console: bind shortcuts to edit content. #34

Open
Carreau opened this issue Jan 19, 2021 · 7 comments
Open

IPython console: bind shortcuts to edit content. #34

Carreau opened this issue Jan 19, 2021 · 7 comments

Comments

@Carreau
Copy link
Contributor

Carreau commented Jan 19, 2021

🚀 Feature

In the embeded console, most shortcut to clear text (Ctrl-C), delete one word (Ctrl-W), exit (Ctrl-D), force insert a new line (Ctrl-O), search in history (Ctrl-R), have no effects, and should likely be bound sensible default.

Motivation

The console is meant to replicate the IPython interface, and should be familiar to user of IPython and of other text base interface.

Pitch

list typical keyboard shortcuts of bash/ipython and replicate them in the console.

Alternatives

  • Do not add those shortcut
  • Add different shortcuts.
@sofroniewn
Copy link
Collaborator

This sounds very reasonable. We're in the process of moving the console into it's own repo and eventually making it a plugin - see https://github.com/napari/napari-console and napari/napari#2118 and so this contribution might happen in the new repo!

@psobolewskiPhD
Copy link
Member

This should probably be transferred to napari/napari-console because I think the PR will belong in that repo, but maybe more visibility here?
What do you think @Carreau ?

@Carreau
Copy link
Contributor Author

Carreau commented Nov 7, 2022

IMHO we should fold napari console back in napari as most issues/PRs there got forgotten.
But it's up to the core devs.

@psobolewskiPhD
Copy link
Member

@Carreau my understanding from conversations with the core devs is that we rather devolve more things to plugins and try and make napari more lean at the core.
Folding the console back in isn't happening.
I think part of the issue is that there arn't too many core devs that use it—I'm a big one though! I'm very keen on extending how napari interacts with scripts via the console.

Either way, the issue is important, but I'm not sure where the fix lies: napari keybinds or napari-console.

@Czaki
Copy link
Contributor

Czaki commented Feb 19, 2023

@Carreau I just launched qtconsole python -m qtconsole that is used as backed for napari-console and these shortcuts are also not working (Ctrl+R is opening rename tab dialog).

So maybe this issue should be raised in qtconsole itself?

@Carreau
Copy link
Contributor Author

Carreau commented Feb 20, 2023

So maybe this issue should be raised in qtconsole itself?

Maybe, I'm not a frequent user/contributor to decide. I think as a library binding by default is bad practice. but I have no preferences.

@psobolewskiPhD
Copy link
Member

I looked into this on the qtconsole side.
There actually are a number of keybinds all hard-coded, e.g start here and scroll:
https://github.com/jupyter/qtconsole/blob/9bd175bb1e6c11e6a7b2b1d2d285cc1358b128ca/qtconsole/console_widget.py#L1313

I'm not sure why they chose the ones they did... they claim to be:

        * Providing the traditional Unix-style console keyboard shortcuts

There was an issue asking about it, but was closed, so seems like a won't implement:
jupyter/qtconsole#240

Maybe we should just document them and get used to it?

@psobolewskiPhD psobolewskiPhD transferred this issue from napari/napari Mar 17, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants