3

So, I have two pans in pycharm: the upper one shows the text editor and the lower one a (embeded) terminal window.

I can copy text from the upper pan and paste it in the lower pan (terminal) and it will run.

My question is, can I set up a keyboard short-cut to directly send a text selection to the terminal (not the python console, the terminal) and if yes, how?

user2413
  • 13,877
  • 17
  • 53
  • 87

2 Answers2

1

You can just do this with the clipboard (Ctrl +C) then open the terminal with Alt+F12 then paste with Ctrl+V

You could wrap this up into a single command by defining a 'quicklist' in Setttings > Appearance & Behaviour > Quick Lists

Then assign that single key sequence using Keymaps which is in Settings

Amias
  • 5,207
  • 20
  • 33
  • Thanks: I want ot paste it in the existing terminal (not a new one). – user2413 Jul 04 '16 at 10:54
  • 1
    Alt+F12 toggles the embedded terminal open or closed , there can only be one embedded terminal in pycharm at once. try it – Amias Jul 04 '16 at 11:01
  • @Amias, I set up a quick list with three commands: copy, open terminal, paste. I don't see how to put all those into a "single command"? After binding the quick list to a keystroke using the keymap, I only see a popup listing the three commands in the quick list. All three commands are not performed in sequence. Can you provide more information? – Kevin Jul 30 '16 at 23:56
0

This pycharm plugin should help.

https://plugins.jetbrains.com/plugin/9409-send-to-terminal

Edit: just tried. it does not work with pycharm terminal emulator. instead it pastes into external terminal.