question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IPython 8 changes terminal cursor

See original GitHub issue

After starting IPython 8.0 and then returning to terminal, the cursor changes from block to I-Beam.

Before: ipy-cursor-before

After: ipy-cursor-after

I need to call reset to get the cursor back to block.

Setup: XFCE terminal + zsh + starship

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
leyceccommented, Jun 7, 2022

Personally, I’d strongly prefer that IPython do nothing whatsoever with the cursor. Even when IPython changes and then restores the cursor as expected, it’s still unexpected. No other terminal application I use forcefully modifies the cursor – not even Vim or zsh. I’d prefer that IPython behave like (almost) everything else in the POSIX ecosystem. Is there a trivial way for end users to disable this questionable functionality without manually modifying IPython source?

If I grok this comment from @jonathanslenders above correctly, the only means of disabling IPython’s cursor modification at the moment is to forcefully pass either cursor_shape_config=None or cursor_shape_config=prompt_toolkit.cursor_shapes.CursorShape.BLOCK to the PromptSession in IPython/terminal/interactiveshell.py. Is that right?

If so, that’s better than nothing; at least I have some recourse. Still, changing the cursor without the user’s permission only disgruntles users. This should ideally be an opt-in option disabled by default.

0reactions
MrMinocommented, Jun 10, 2022

Personally, I’d strongly prefer that IPython do nothing whatsoever with the cursor. Even when IPython changes and then restores the cursor as expected, it’s still unexpected. No other terminal application I use forcefully modifies the cursor – not even Vim or zsh. I’d prefer that IPython behave like (almost) everything else in the POSIX ecosystem. Is there a trivial way for end users to disable this questionable functionality without manually modifying IPython source?

If I grok this comment from @jonathanslenders above correctly, the only means of disabling IPython’s cursor modification at the moment is to forcefully pass either cursor_shape_config=None or cursor_shape_config=prompt_toolkit.cursor_shapes.CursorShape.BLOCK to the PromptSession in IPython/terminal/interactiveshell.py. Is that right?

If so, that’s better than nothing; at least I have some recourse. Still, changing the cursor without the user’s permission only disgruntles users. This should ideally be an opt-in option disabled by default.

If you’d like to make this configurable, I’d be happy to accept a PR that adds the option. Just make sure to take other PRs that are currently open into account, specifically those open by @jonathanslenders.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IPython 8 changes terminal cursor · Issue #13472 - GitHub
After starting IPython 8.0 and then returning to terminal, the cursor changes from block to I-Beam. Before: After: I need to call reset...
Read more >
8.x Series — IPython 8.7.0 documentation
IPython 8.0.1, 7.31.1 and 5.11 are security releases that change some default values in order to prevent potential Execution with Unnecessary Privileges.
Read more >
Changing the cursor shape in the interactive IPython consle ...
Is there a way that I can make the cursor change shape to a block when in vi's normal mode and then back...
Read more >
11 Practical Tips You Need to Know to Personalize Jupyter ...
Firstly, I need to import it from font.googleapis.com. You can also change the weight using a similar CSS with the previous one. The...
Read more >
How to change the color and symbol of the cursor in Tkinter?
In such cases, changing the cursor color makes the mouse pointer distinguishable. The color of the cursor can be changed by specifying the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found