Skip to content

Add pass-through filter for shortcuts#14080

Merged
Carreau merged 2 commits intoipython:mainfrom
krassowski:right-arrow-fix
Jun 2, 2023
Merged

Add pass-through filter for shortcuts#14080
Carreau merged 2 commits intoipython:mainfrom
krassowski:right-arrow-fix

Conversation

@krassowski
Copy link
Copy Markdown
Member

This is one way to fix #14070.

The alternatives are:

  • try to change upstream prompt-toolkit to fire all matching keybindings, not only the last one as it does currently
    • this would be breaking so we would need to wait for a major release if this would be accepted
    • unless instead of firing all matching keybindings only keybindings which oped in via a flag would be additionally fired (there is a precedent of eager flag)
  • add a tailored function with logic that figures out what to do based on state of application - I am not a fan of this as these are hard to test already.

@krassowski krassowski added the autosuggestions Related to fish-like autosuggestion feature (as opposed to the tab-completions) label May 20, 2023
@albireox
Copy link
Copy Markdown

I can confirm this fixes the issue for me with Python 3.11.3.

@krassowski krassowski requested a review from Carreau May 28, 2023 16:36
@Carreau Carreau added this to the 8.14 milestone Jun 2, 2023
@Carreau Carreau merged commit 61fc0ab into ipython:main Jun 2, 2023
@ashtuchkin
Copy link
Copy Markdown

Nice! Is it possible to backport this to 8.12.x? We're stuck with Python 3.8 for now.

@Carreau
Copy link
Copy Markdown
Member

Carreau commented Sep 12, 2023

Nice! Is it possible to backport this to 8.12.x? We're stuck with Python 3.8 for now.

let's see ...

@meeseeksdev backport to 8.12.x

@Carreau
Copy link
Copy Markdown
Member

Carreau commented Sep 12, 2023

Backport seem to be clean, so I'll likely make a release by end of month.

In general feel free to backport and send a PR on older branches. I'm likely to miss notification on closed issues/PRs.

Carreau added a commit that referenced this pull request Sep 15, 2023
…tcuts) (#14160)

Backport PR #14080: Add pass-through filter for shortcuts
EliahKagan added a commit to EliahKagan/EmbeddingScratchwork that referenced this pull request Dec 4, 2023
This constrains openai<1 for now. Showing how to work with and wrap
the old Python API is a central part of this project, so it's
unclear what will be done with that moving forward. The options are
to stay with <1 indefinitely, move up to 1, or support both
conditionally (which should usually be avoided, but for this
project it might be nice to show how to do so when needed). Note
that embeddings_utils is not present in openai>=1.

Less importantly, this also pins ipython back to ~8.12.3, which is
actually a downgrade. This is to support Python 3.8. Before, we
were installing an older version just on older Pythons, as we do
with numpy and scipy. For ipython, the reason to give newer Pythons
the newer version was that the convenient and popular way to
autocomplete a full line, by pressing right-arrow, was broken, and
the fix initially had not been backported. This is now fixed, due
to the backporting of ipython/ipython#14080
to 8.12, which is in the 8.12.3 patch.
EliahKagan added a commit to EliahKagan/EmbeddingScratchwork that referenced this pull request Dec 4, 2023
This constrains openai<1 for now. Showing how to work with and wrap
the old Python API is a central part of this project, so it's
unclear what will be done with that moving forward. The options are
to stay with <1 indefinitely, move up to 1, or support both
conditionally (which should usually be avoided, but for this
project it might be nice to show how to do so when needed). Note
that embeddings_utils is not present in openai>=1.

Less importantly, this also pins ipython back to ~8.12.3, which is
actually a downgrade. This is to support Python 3.8. Before, we
were installing an older version just on older Pythons, as we do
with numpy and scipy. For ipython, the reason to give newer Pythons
the newer version was that the convenient and popular way to
autocomplete a full line, by pressing right-arrow, was broken, and
the fix initially had not been backported. This is now fixed, due
to the backporting of ipython/ipython#14080
to 8.12, which is in the 8.12.3 patch.
EliahKagan added a commit to dmvassallo/EmbeddingScratchwork that referenced this pull request Dec 4, 2023
This constrains openai<1 for now. Showing how to work with and wrap
the old Python API is a central part of this project, so it's
unclear what will be done with that moving forward. The options are
to stay with <1 indefinitely, move up to 1, or support both
conditionally (which should usually be avoided, but for this
project it might be nice to show how to do so when needed). Note
that embeddings_utils is not present in openai>=1.

Less importantly, this also pins ipython back to ~8.12.3, which is
actually a downgrade. This is to support Python 3.8. Before, we
were installing an older version just on older Pythons, as we do
with numpy and scipy. For ipython, the reason to give newer Pythons
the newer version was that the convenient and popular way to
autocomplete a full line, by pressing right-arrow, was broken, and
the fix initially had not been backported. This is now fixed, due
to the backporting of ipython/ipython#14080
to 8.12, which is in the 8.12.3 patch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosuggestions Related to fish-like autosuggestion feature (as opposed to the tab-completions)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cannot move cursor right

4 participants