How to get previous command in Pycharm python REPL

Answered

I have a flask app with flask-script installed to run a shell with the flask context.

 

Whenever I hit the up arrow, instead of bringing up the last command, it just moves the cursor up.  How can you get previous commands?

 

Additionally, it does not pick up the ipython so there is no completion.  I'd imagine this should work just like  a django project's python console.

6 comments
Comment actions Permalink
Official comment

Hello. Please configure django support in PyCharm and use Django console: https://blog.jetbrains.com/pycharm/2010/03/repl-and-django-console/

Comment actions Permalink

Hello.

Do you run it as Python script?

Up/Down should work only for "Python console". PyCharm does not support Flask-bases python console for now, please vote for https://youtrack.jetbrains.com/issue/PY-28080

0
Comment actions Permalink

Here is a screen shot of the configuration I am running as well as the console.  If i run `python manage.py shell` from the terminal (alt-f12) then I will be able to use standard Terminal functionality like using the up arrow for the previous command.

How can I get that basic functionality when using the terminal via the run button?

0
Comment actions Permalink

@ilya

Seriously?  Its a Flask app.  Not a django application.  Are you trolling?

0
Comment actions Permalink

Oops, I am sorry.

 

For Flask you may open "Python Console" and import Flask there. There is no other way to support "Flask shell" now.

Please vote for this feature request https://youtrack.jetbrains.com/issue/PY-28080

0
Comment actions Permalink

hit one after another Page UpArrow up . The same for next command. I know that it's not a shortcut, but you can do it quite fast. And these keys are usually neighbors 

0

Please sign in to leave a comment.