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

pressing arrow key when editing code cell sometimes doesn't work #13263

Closed
1 of 2 tasks
yuuuxt opened this issue Apr 4, 2023 · 55 comments
Closed
1 of 2 tasks

pressing arrow key when editing code cell sometimes doesn't work #13263

yuuuxt opened this issue Apr 4, 2023 · 55 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority verified Verification succeeded
Milestone

Comments

@yuuuxt
Copy link

yuuuxt commented Apr 4, 2023

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Not sure how the issue is triggered, it just happened when using notebook:

  • arrow key doesn't work anymore (typing still works)
  • up/down when "accross-the-cell" still works (from "frozen cell" to another cell)
  • change it to markdown then it works fine; then changing back arrow key again stops working;
  • pasting contents to a new cell - it depends on where the new cell is created, and seems is not related to the content itself.

I feel It's possible that it's because of other extensions. I will have a try disabling some.

Below is an illustration when I hold arrow down/up:

temp2

VS Code Version

1.77.0

Jupyter Extension Version

v2023.3.1000892223

Jupyter logs

(seems nothing related. the last lines are:)

info 16:49:35.053: Cancel all remaining cells true || Error || undefined
info 10:24:44.793: Cancel all remaining cells true || Error || undefined
info 10:29:40.538: Cancel all remaining cells true || Error || undefined
info 10:30:30.891: Cancel all remaining cells true || Error || undefined
info 10:30:39.537: Cancel all remaining cells true || Error || undefined

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Remote

@yuuuxt yuuuxt added the bug Issue identified by VS Code Team member as probable bug label Apr 4, 2023
@roblourens
Copy link
Member

You can run the command "Toggle keyboard shortcuts troubleshooting" to get some details on what is happening when you press the arrow key, and it might point you towards an extension or a bad context key

@roblourens roblourens added the info-needed Issue requires more information from poster label Apr 4, 2023
@rebornix rebornix assigned rebornix and unassigned roblourens Apr 4, 2023
@rebornix rebornix removed the info-needed Issue requires more information from poster label Apr 4, 2023
@rebornix rebornix added this to the April 2023 milestone Apr 4, 2023
@rebornix rebornix added the info-needed Issue requires more information from poster label Apr 4, 2023
@rebornix
Copy link
Member

rebornix commented Apr 4, 2023

This is likely a duplicate of #12738, will ping once we have a fix for it in Insiders.

@rebornix rebornix removed the info-needed Issue requires more information from poster label Apr 4, 2023
@kavmax
Copy link

kavmax commented Apr 7, 2023

Same problem

rebornix added a commit to microsoft/vscode that referenced this issue Apr 9, 2023
…pdate editor context on markdown preview.
sourcegraph-bot pushed a commit to sgtest/megarepo that referenced this issue Apr 10, 2023
…13263. Update editor context on markdown preview. (#179569)

Commit: 7f03ec6f7a48791d8027761b22773b454fc52478
rebornix added a commit to microsoft/vscode that referenced this issue Apr 10, 2023
@rebornix
Copy link
Member

This issue will be fixed and released in tomorrow's VS Code Insiders. Thank you for the input.

@phipz
Copy link

phipz commented Apr 12, 2023

Same problem!

@Zhangyanbo
Copy link

I have the same problem after the update. I have never face this bug before.

@icarofm
Copy link

icarofm commented Apr 14, 2023

I have the same problem, I don't know how to replicate it, but apparently it happens to me sometime after using the "home" / "end" or "shift+home" / "shift+end" keys

VS Code Version

1.77.3

Jupyter Extension Version

v2023.3.1201040234

@dlefcoe
Copy link

dlefcoe commented Apr 17, 2023

i get the same thing. I am running a clean new version of vs code with only the python extension and one other extension (Edit CSV). After many years of using VS code I have never faced this bug before. (python version 3.11, vs code version 1.77.3 ).

Restarting the workbook resolves the problem, but then it seems to randomly (not sure what triggers this) reoccur...

@joecorsi
Copy link

same problem. closing and reopening the notebook fixes it. seems only recently to have become an issue. python 3.10.9 vs code 1.77.3

@Vulwsztyn
Copy link

For me left arrow resolves to this:

2023-04-19 15:46:39.117 [info] [KeybindingService]: | Resolving LeftArrow
2023-04-19 15:46:39.117 [info] [KeybindingService]: \ From 11 keybinding entries, matched editor.action.scrollLeftHover, when: editorHoverFocused, source: built-in.
2023-04-19 15:46:39.117 [info] [KeybindingService]: + Invoking command editor.action.scrollLeftHover.

instead of cursorLeft

@rebornix
Copy link
Member

Thank you for your feedbacks. The fix was not shipped in 1.77.3 but is available in Insiders and also the next 1.78 stable.

@AnnaGolubeva
Copy link

when is 1.78 with the fix coming out? this issue is making it nearly impossible for me to work with vscode

@PeterJamesLawson
Copy link

So the issue is marked 'closed', but the fix isn't in the current stable release, and the time line for the next stable release version is unknown?

@lvdtweel
Copy link

According to April 2023 Endgame #180716, 1.78 is expected to be released somewhere early next week (May 1-3).

@rzhao271 rzhao271 added the verified Verification succeeded label Apr 27, 2023
@ArimJin
Copy link

ArimJin commented May 4, 2023

still same problem OTL

@miedda
Copy link

miedda commented May 5, 2023

This issue still exists in 1.78

@rebornix rebornix added this to the May 2023 milestone May 15, 2023
@rebornix rebornix removed the verified Verification succeeded label May 15, 2023
@rebornix
Copy link
Member

Thank you all for the detailed reproduce steps and analysis. The arrow key is very hijacked by editor.action.scroll*Hover command whose context keys might not be updated properly. cc @aiday-mar

@rebornix rebornix added the important Issue identified as high-priority label May 15, 2023
@Linusnie
Copy link

Linusnie commented May 15, 2023

glad to hear this is getting looked into! To add to the temporary fixes people already suggested I also added this to make the escape key work:

    { "key": "escape", "command": "-editor.action.escapeFocusHover", "when": "editorHoverFocused" },

@SunYong0821
Copy link

1.78.2 still exists

@rebornix
Copy link
Member

I figured out one way to reproduce this issue:

  • Hover on a variable
  • Click on the Hover (which makes it focused)
  • Enter, which focuses the cell container
  • Click on the Hover again, which will set editor selection
  • Move mouse away, Hover disappears, and then the arrow keys are stuck
Screen.Recording.2023-05-16.at.11.19.42.AM.mov

@aiday-mar we need to figure out how to update the context key in this scenario.

@matrs
Copy link

matrs commented May 17, 2023

In the latest 1.78.1.
This makes vs-code close to be unusable for notebooks. Also, this bug didn't exist a few months ago.

@xareelee
Copy link

  • VSCode 1.78.2
  • Jupyter Extension v2023.4.1011241018

I face this issue/bug for 1~2 months.

@mmalex
Copy link

mmalex commented May 19, 2023

Pressing Ctrl+K and Ctrl+I twice, to enter and exit hover mode, seems to work around this issue if you run into it. (or command+K, command+I on mac)

@Ar-Kareem
Copy link

I found a workaround that permanently made this issue go away for me, I just had to unbind the scroll hover commands

See here #13514 (comment)

@mapio
Copy link

mapio commented May 21, 2023

I found a workaround

This actually was known since weeks ago #13263 (comment), #13263 (comment) just to make a few examples.

@kimnegrette3
Copy link

Hi! I'm still facing this issue. VSCode Version: 1.78.2. Anyone could work their way around on mac? Thanks!

@Ar-Kareem
Copy link

Hi! I'm still facing this issue. VSCode Version: 1.78.2. Anyone could work their way around on mac? Thanks!

Yes try unbinding scroll hover as suggested above.

@plauria
Copy link

plauria commented May 23, 2023

I note that this issue also applies to the Home and End keys as well. Similarly to the above workarounds, removing "hover" keybindings from those keys fixes things.

@Groni3000
Copy link

Pressing Ctrl+K and Ctrl+I twice, to enter and exit hover mode, seems to work around this issue if you run into it. (or command+K, command+I on mac)

This is the best advice here. Thanks a lot! Why should I unbind hover commands or something like this to make it work :/ Your advice much much better, it helps to mitigate the problem until it get fixed.

@starball5
Copy link

@rebornix
Copy link
Member

This issue should now be fixed in latest VS Code Insiders and will be available in next week's Stable release. Thank you everyone for your patience and valuable troubleshooting tips.

@raespanha
Copy link

I have been struggling with this problem for weeks, specifically in certain cells. Even after deleting and recreating those cells, the issue persisted in that particular cell, which was quite frustrating.

However, I found a workaround that seems to work. It involves hovering over a method in the affected cell, clicking in the documentation window, and then pressing the arrow keys. By doing so, the arrow keys start functioning properly.

I hope this solution proves helpful in your situation.

image

@francisohara24
Copy link

Same issue here.

@avtaliong
Copy link

I have a workaround - Hover over a variable or a function and click on the hovered window press escape and arrows are back

@AlvaroMatsuda
Copy link

I have a workaround - Hover over a variable or a function and click on the hovered window press escape and arrows are back

This worked for me. But as he said is a workaround. It would be nice if this behavior is fixed

@AndrewLaganaro
Copy link

AndrewLaganaro commented Aug 1, 2023

August and it still exists.
Jupyter extension: v2023.3.1201040234
Python extension: v2023.6.1
Vs code version: 1.77.3

Solved by closing and reopening Vscode

@zachwarner
Copy link

zachwarner commented Aug 24, 2023

I'm not sure if this is a separate issue, but the broken arrow key behavior persists for me when running ipython in the integrated terminal (R and Python are both unaffected). I implemented the hover keybinding workaround, which did not resolve it. Versions as follows:

VSCode: 1.81.1
Python: v2023.14.0
Jupyter: v2023.7.1002162226

Update: I'll leave this here in case anyone arrives via google like I did. Apparently it's an ipython issue. Here's a solution that worked for me.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests