vscode-jupyter
vscode-jupyter copied to clipboard
Interactive Window Command History Search / Autocomplete
Is it possible to add some kind of reverse search or autocomplete to the python interactive window input pane?
It would be great to be able to recall and re-run commands from session history and as far as I can tell right now you can only press the up/down keys to cycle through the history one command at a time in consecutive order. Some solutions: reverse search like iPython (though Ctrl-R is the hotkey for the global vs-code recent command list), or - better yet - autocomplete from the history with Ctrl-Up like RStudio does in its console.
@oakstreetrec That's an interesting suggestion. Thanks for filing it. I've tagged it with the enhancement tag.
the ipython terminal also supports filtering the history by typing the beginning of the statement you are looking for. E.g., when typing foobar = and then using arrow-up to cycle through the history, only history entries starting with foobar = will be used. I find that extremely convenient and right now it's the main thing I'm missing in VS Code's jupyter extension.
Or at least show the history in a different window/editor
I use python mostly in interactive mode for algorithm development, and this is a feature in ipython I heavily use. Is there a way this will be added to vscode anytime soon - or is there a workaround for it?
Seconding @matthias-k , I'm so very missing this functionality in the python interactive window in VS Code (jupyter)
kind of new to vscode but with a lot of experience with other IDEs/bash/etc and very surprised this does not exist. to me it is very important if you are exploring data, but perhaps even in developer mode it can also be helpful (e.g debugging)
The history feature for the interactive window is even worse for the updated version. The history is not in the correct order anymore because commands do not repeat if you execute them again. If you want to execute two commands from history, it's very cumbersome, because after executing the first, you are brought back to the most recent commands - meaning you have to scroll back up. Additionally it is not very easy to clear the command line by pressing esc or the down arrow, instead you have to select all and delete.
The history feature for the interactive window is even worse for the updated version. The history is not in the correct order anymore because commands do not repeat if you execute them again. If you want to execute two commands from history, it's very cumbersome, because after executing the first, you are brought back to the most recent commands - meaning you have to scroll back up. Additionally it is not very easy to clear the command line by pressing esc or the down arrow, instead you have to select all and delete.
Completely agree. I was looking forward to the updated, integrated interactive window. Unfortunately, the 'history' behavior of this new system seems to be a downgrade. I reverted back to the old interactive system for now.
Additionally it is not very easy to clear the command line by pressing esc or the down arrow, instead you have to select all and delete.
@m-croft We've fixed this in the latest Insiders build and upcoming Stable--you can now use esc to clear the command line. Please let us know if this isn't resolved for you.
The history is not in the correct order anymore because commands do not repeat if you execute them again. If you want to execute two commands from history, it's very cumbersome, because after executing the first, you are brought back to the most recent commands - meaning you have to scroll back up.
Thanks for highlighting this--I have opened https://github.com/microsoft/vscode/issues/131659 to track improving this behavior in the new interactive window (the UI for which is now implemented in VS Code core).
VS code has made tremendous strides into improving the interactive window experience and addressing this issue (feature) would allow me and many of my colleagues who are still using Spyder and its interactive window functionalities to fully transition to VS code. We use this feature heavily when we work with data-frames, playing around/testing different data manipulation, transformation, querying and other commands.
We could experiment with using the suggest widget, although that would mean the normal suggestions would be combined with the history of the IW.
Has there been any updates on this? This feature would also be extremely useful for me. If manpower is an issue I am definitely willing to help out on this one.
An alternative to using the suggest widget could be some sort of lighter gray text such as in fish, and pressing the right arrow would autocomplete the full command:

It seems that this could potentially be done as the with the hint/placeholder attribute, as when the input box is empty it displays some hint text:

note: Terminal: Run Recent Command is doing something very similar that we could possibly re-use
I really like vscode, it is an excellent IDE. however I cannot use it for my main tasks without this feature. Is there no way to forward the up/down keys to the underlying ipython kernel which does the job? It even caches commands so I can still look up my previous commands after the kernel is restarted. This single feature puts data explorations (crucial for algorithm development) and debugging to an other level.
I'm amazed this has still not been implemented. It's such a common and basic feature in iPython, terminals, and other similar interfaces. Make it exactly like iPython please. @matthias-k suggested this almost 3 years ago!
I would really love this feature. It seems like a very basic productivity enhancement. I really miss it when i am using the interactive window. Can we please have it?
Seconded. I think it's a problem if manually copying and pasting commands a few inches up on my screen is often easier than scrolling through the history. Seems like a pretty simple feature that would have huge benefits. Please consider prioritizing this.
Hello all, I've just had to reinstall my environment and have the latest vs code and python extensions installed.
Something really strange is now happening that when I press the up arrow I ONLY get the last command executed. Nothing before that. If the cell is blank it replaces it but it's not scrolling back through the history. This is infuriating to live without, hoping someone has some suggestions!! The interactive.history.previous command is definitely firing as I've experimented with the key bind.
@N3Cr0 - you should open a new issue for that.