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

Interactive Window Command History Search / Autocomplete #4716

Open
oakstreetrec opened this issue Feb 8, 2021 · 21 comments
Open

Interactive Window Command History Search / Autocomplete #4716

oakstreetrec opened this issue Feb 8, 2021 · 21 comments
Assignees
Labels
feature-request Request for new features or functionality interactive-window Impacts interactive window

Comments

@oakstreetrec
Copy link

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.

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Feb 9, 2021
@IanMatthewHuff
Copy link
Member

@oakstreetrec That's an interesting suggestion. Thanks for filing it. I've tagged it with the enhancement tag.

@matthias-k
Copy link

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.

@lleeoo
Copy link

lleeoo commented Mar 28, 2021

Or at least show the history in a different window/editor

@akkiss
Copy link

akkiss commented Jun 9, 2021

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?

@ryblogs
Copy link

ryblogs commented Jun 9, 2021

Seconding @matthias-k , I'm so very missing this functionality in the python interactive window in VS Code (jupyter)

@vttrifonov
Copy link

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)

@greazer greazer added the interactive-window Impacts interactive window label Aug 3, 2021
@m-croft
Copy link

m-croft commented Aug 19, 2021

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.

@ryblogs
Copy link

ryblogs commented Aug 25, 2021

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.

@joyceerhl
Copy link
Contributor

joyceerhl commented Aug 25, 2021

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 microsoft/vscode#131659 to track improving this behavior in the new interactive window (the UI for which is now implemented in VS Code core).

@greazer greazer added feature-request Request for new features or functionality and removed enhancement labels May 4, 2022
@kmitkovk
Copy link

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.

@amunger
Copy link
Contributor

amunger commented Sep 29, 2022

We could experiment with using the suggest widget, although that would mean the normal suggestions would be combined with the history of the IW.

@ezhang7423
Copy link

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.

@ezhang7423
Copy link

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:
image

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:
image

@amunger
Copy link
Contributor

amunger commented Mar 22, 2023

note: Terminal: Run Recent Command is doing something very similar that we could possibly re-use

@akkiss
Copy link

akkiss commented Sep 8, 2023

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.

@rebornix rebornix removed their assignment Dec 6, 2023
@juandpinto
Copy link

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!

@landisrm
Copy link

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?

@jpalmer37
Copy link

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.

@N3Cr0
Copy link

N3Cr0 commented Mar 8, 2024

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.

@amunger
Copy link
Contributor

amunger commented Mar 11, 2024

@N3Cr0 - you should open a new issue for that.

@thanojo
Copy link

thanojo commented May 12, 2024

Please please please please please just make this happen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality interactive-window Impacts interactive window
Projects
None yet
Development

No branches or pull requests