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

Add modal cursor option for when using vi mode #292

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jsr-p
Copy link

@jsr-p jsr-p commented Apr 2, 2023

This PR adds the option of having a modal cursor when using the vi mode.
It does this by setting the cursor option of the PromptSession equal to an instance of
ModalCursorShapeConfig from here.
Furthermore, it adds two news options to the config file:

  1. The option to have a modal cursor (when using vi mode)
  2. An option to change the ttimeoutlen parameter of the main Application from prompt_toolkit

The ttimeoutlen is a timeout setting that affects the handling of keys; in this case, when to flush the input. I.e. it determines how long does it it take when the escape key has been pressed for prompt_toolkit to register this and change the prompt layout according to the vi mode. See the prompt_toolkit docs.

Together with #289 this yields a descent vi mode layout for the jupyter_console.

@jsr-p jsr-p force-pushed the feat/add-vi-modal-cursor branch from 5f859ab to 25e32b4 Compare April 2, 2023 11:14
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

Successfully merging this pull request may close these issues.

1 participant