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.

Run selection shortcut not working while focused on console

See original GitHub issue

While a portion of code is highlighted in Editor but the focus is on a console (Python or iPython), Run selection shortcut F9 is not running the selection. Run > Run selection menu works properly. If I am not mistaken, F9 would workas expected in Spyder 2.

Versions and main components

Spyder Version: 3.0.0.dev0
Python Version: Python 2.7.12 64 bits
Operating system: Windows 10

Dependencies

> jedi >=0.8.1 : 0.9.0 (OK)
> matplotlib >=1.0 : 1.5.1 (OK)
> nbconvert >=4.0 : 4.2.0 (OK)
> numpy >=1.7 : 1.11.1 (OK)
> pandas >=0.13.1 : 0.18.1 (OK)
> pep8 >=0.6 : 1.7.0 (OK)
> pyflakes >=0.5.0 : 1.2.3 (OK)
> pygments >=2.0 : 2.1.3 (OK)
> qtconsole >=4.2.0: 4.2.1 (OK)
> rope >=0.9.4 : 0.9.4 (OK)
> sphinx >=0.6.6 : 1.4.1 (OK)
> sympy >=0.7.3 : 1.0 (OK)

I would like to note that I am willing to try and locate (and perhaps fix) this issue myself. In case someone can reproduce this and think this can be handled by someone who’s willing to get familiar with Spyder’s code base, please feel free to guide me to relevant part of the source!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
bcolsencommented, May 9, 2020

I believe he is talking about pressing up to go through previous commands.

The issue here would be if the cursor was at the bottom line, you would have to scroll through all the lines to get to the next previous command.

If I need to run more than a few lines in the console I will use codecells. You can even open a new file type your lines and hit control-enter. No saving necessary.

1reaction
ccordoba12commented, May 9, 2020

I haven’t seen any argument here that an “up arrow+enter” in the console to run the previous entry wouldn’t fix.

Exactly.

If it was global I would expect that it would run the selected text in the currently active pane. For example running a line of code from the history, a previous command in the console or even an example from the documentation.

Agreed. The UX would become quite more complex and confusing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code: Shift+Enter does not send code to Python Interactive
in Interactive Windows and Run Cell to Shift + Enter , Alt + Enter and Ctrl + Enter , respectively, or whatever you...
Read more >
Automatically move focus to console during run - Stack Overflow
One alternative is to change the settings in Tools > Global Options > Code and select "Focus console after executing from source".
Read more >
144943 - Add keyboard shortcut to focus the developer console
Issue 144943: Add keyboard shortcut to focus the developer console · 1. Open devtools, either right click - Inspect Element or Ctrl +...
Read more >
JetBrains Rider - Keyboard shortcut not working?
Press Ctrl+Alt+S to open the IDE settings and select Keymap. · Make sure that you are using the correct keymap. · Use the...
Read more >
Keyboard shortcuts - Chrome Developers
Keyboard shortcuts for opening DevTools. To open DevTools, press the following keyboard shortcuts while your cursor is focused on 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