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

send to console does not work #16272

Open
hutch3232 opened this issue May 1, 2024 · 2 comments
Open

send to console does not work #16272

hutch3232 opened this issue May 1, 2024 · 2 comments
Labels
bug tag:Regression Behavior that had been broken, was fixed, and is broken again
Milestone

Comments

@hutch3232
Copy link

hutch3232 commented May 1, 2024

Description

A common work flow I have is to open a .py file, then create a console for it. I'll then interactively work, running line by line by sending to console with shift+enter. I am finding that in certain (common) situations some lines won't send to console.

I have found two work arounds:

  • highlight the entire row then shift+enter
  • put the cursor at the very initial position of the line, then shift+enter

Reproduce

  1. Open a new .py file
  2. right-click on it and select "create console for editor"
  3. Create the following script
12
1

Sending the first line will work. Update to:

123
1

Now the first line will not send.
Update to:

123
12

Now the first line will send again.
Update to:

1234
12
12

This will send, but it positions you between the first and second character of line 3.
(This assumes you're placing the cursor at the right-end of the line in these tests).
It seems if the cursor position is greater than the length of subsequent lines (combined?) it will send, but it jumps to a line-length dependent position (not always to the end of the line).

Expected behavior

The sending of code should not be line-length dependent. It should send and jump your cursor to the next line of code (and be positioned at the same relative position (beginning or end of line).

Context

  • Operating System and version: Linux Ubuntu 20.04
  • Browser and version: Chrome 123
  • JupyterLab version: I have tried 4.0.9, 4.1.5, 4.1.6, and 4.1.8
    • This does not happen prior to 4.0.0 (or at least not 3.6.6 which I previously used)

I can provide the troubleshoot and command line output, if needed, but the "out of range" error seen in the browser output seems to me that it might be sufficient info.

Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
4405.43dab120fea32f30bbb9.js?v=43dab120fea32f30bbb9:1 Uncaught (in promise) RangeError: Selection points outside of document
    at J (4405.43dab120fea32f30bbb9.js?v=43dab120fea32f30bbb9:1:20835)
    at new gt (4405.43dab120fea32f30bbb9.js?v=43dab120fea32f30bbb9:1:27867)
    at gt.create (4405.43dab120fea32f30bbb9.js?v=43dab120fea32f30bbb9:1:28001)
    at vt (4405.43dab120fea32f30bbb9.js?v=43dab120fea32f30bbb9:1:30042)
    at Mt.update (4405.43dab120fea32f30bbb9.js?v=43dab120fea32f30bbb9:1:32155)
    at Os.dispatch (4986.a497cdda4b7152902568.js?v=a497cdda4b7152902568:1:118817)
    at ne.setCursorPosition (jlab_core.b91074b1e57242ddcd31.js?v=b91074b1e57242ddcd31:1:345454)
    at execute (jlab_core.b91074b1e57242ddcd31.js?v=b91074b1e57242ddcd31:1:799677)
    at g.execute (jlab_core.b91074b1e57242ddcd31.js?v=b91074b1e57242ddcd31:1:1723219)
    at execute (jlab_core.b91074b1e57242ddcd31.js?v=b91074b1e57242ddcd31:1:68801)
@hutch3232 hutch3232 added the bug label May 1, 2024
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label May 1, 2024
Copy link

welcome bot commented May 1, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@hutch3232 hutch3232 changed the title send to console does not work on last line of code in file send to console does not work May 2, 2024
@JasonWeill JasonWeill removed the status:Needs Triage Applied to new issues that need triage label May 7, 2024
@HereticSK
Copy link

I run into very similar issue. I was able to run a single selected line by putting the cursor at the beginning of the line.

After upgrading to 4.2.0, The shortcut "Shift+Enter" does not work anymore, no matter how I place the cursor. But if I use click the "Run selected code" in the "run" menu, the line successfully runs on the console. I guess it is an issue related to keyboard shortcut.

@krassowski krassowski added this to the 4.2.x milestone May 21, 2024
@krassowski krassowski added the tag:Regression Behavior that had been broken, was fixed, and is broken again label May 21, 2024
@krassowski krassowski modified the milestones: 4.2.x, 4.0.x May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tag:Regression Behavior that had been broken, was fixed, and is broken again
Projects
None yet
Development

No branches or pull requests

4 participants