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 console does not provide command history in debugger #550

Closed
daleecc opened this issue Mar 15, 2017 · 48 comments
Closed

Interactive console does not provide command history in debugger #550

daleecc opened this issue Mar 15, 2017 · 48 comments
Labels
Issue-Bug A bug to squash.

Comments

@daleecc
Copy link

daleecc commented Mar 15, 2017

System Details

  • Operating system name and version: Windows 7 (64-Bit)
  • VS Code version: 1.10.2
  • PowerShell extension version: 0.10.0
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.0.10586.117
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.10586.117
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When executing commands in the integrated terminal, the up and down arrows on the keyboard to browse through command history do not work.

For example:

  1. Execute a command such as Get-Item
  2. When the command is finished, I would expect to be able to press the up arrow on the keyboard and have Get-Item re-appear as the command to run. Instead, the command input remains blank.
@daviwil
Copy link
Contributor

daviwil commented Mar 15, 2017

Are you typing in the command or using F8 to execute it? What is the output of the Get-History command? History should be working for you.

@daviwil daviwil added the Issue-Bug A bug to squash. label Mar 15, 2017
@daleecc
Copy link
Author

daleecc commented Mar 15, 2017

Sorry missed some information. This is only an issue while debugging when a breakpoint is hit and commands are being manually entered via the terminal.

@daviwil
Copy link
Contributor

daviwil commented Mar 15, 2017

Thanks! I'll check on that.

@daviwil daviwil changed the title Interactive console does not provide command history Interactive console does not provide command history in debugger Mar 15, 2017
@daviwil daviwil added this to the 0.11.0 milestone Mar 15, 2017
@daviwil
Copy link
Contributor

daviwil commented Mar 15, 2017

Definitely a bug here. I'll fix it when I overhaul command history in a few days.

@daviwil daviwil modified the milestones: 0.11.0, 0.12.0 Mar 22, 2017
@daviwil daviwil modified the milestones: 0.12.0, Next Patch Update, Next Feature Update Apr 4, 2017
@daviwil daviwil modified the milestones: April 2017, May 2017 May 8, 2017
@DexterPOSH
Copy link

This is a pain, typing the commands again and again on the interactive console while debugging. Hoping this gets fixed soon.

@daviwil daviwil modified the milestones: 1.2.0, May 2017, 1.3.0 May 25, 2017
@SeeminglyScience
Copy link
Collaborator

@bergmeister careful now, my price is steep 😉 (PowerShell/PSScriptAnalyzer#850)

@bergmeister
Copy link
Contributor

@SeeminglyScience Phew, I'm glad you did not pick one of the many PSUseDeclaredVarsMoreThanAssignments issues that all require a re-write of the rule...
Jokes aside, I think your referenced issue is really important because it is a blocker for many people. I had it already in the back of my mind to look at it but you confirmed that it really needs to be investigated and hopefully properly fixed.

@Sharken03
Copy link

+1
SeeminglyScience has a commit ready since October 2017, but it seems that commit is just the tip of the iceberg. Anyways, would be really good with an ETA, as this issue prevents me from using VS Code with PowerShell.

@sdcscripts
Copy link

sdcscripts commented Mar 26, 2018 via email

@WaynePlummer
Copy link

Any update on general availability for this fix yet? I am also in the group who want to drop the ISE but find this issue a show-stopper.

@bergmeister
Copy link
Contributor

@WaynePlummer Current core work for it is happening in this PR: PowerShell/PowerShellEditorServices#672
But it might take some time afterwards for a release of the vscode-powershell, which is probably going to be of version 2 due to breaking changes (PowerShell versions before 5 will not be supported any more)

@ngetchell
Copy link

I generally debug code in the ISE for this reason. This is my last reservation.

@Sharken03
Copy link

Sharken03 commented Jun 25, 2018

@bergmeister
Thanks for the link to the pull request 672, now i am wondering if comments to that pull request should go on that thread or on this current thread.
Opting for the last choice, i have made the following observations:

  • Starting a debug session with F5 should set focus to the editor window and not the terminal window. CTRL + 1 will return you to the editor window.
  • It feels like a workaround to use F8 in order to move from editor window to the terminal window. But in practice it gets the job done.

@TylerLeonhardt
Copy link
Member

@Sharken03, thanks for the feedback! Definitely leave comments on the PR so that we can address them.

As for your current comments, can you try setting powershell.integratedConsole.focusConsoleOnExecute to False and see if that accomplishes what you want?

@Sharken03
Copy link

Sharken03 commented Jul 2, 2018

@tylerl0706
With focusConsoleOnExecute set to False, the focus is set to the editor window. But now F8 will not set focus to the Terminal window, as that behavior is also controlled by focusConsoleOnExecute. Guess i will have to find another shortcut for setting focus to the terminal window.

Update:
Following the idea outlined on Stackoverflow, you can have a toggle to switch between editor window and the terminal. Note that if you are not using an english keylayout, then it is better to use CTRL+K CTRL+K, to let VS Code tell you what key that corresponds with.

@rkeithhill
Copy link
Contributor

rkeithhill commented Jul 2, 2018

Here are a couple of keyboard shortcut customizations I use that you might find helpful:

  { "key": "ctrl+`",          "command": "workbench.action.focusActiveEditorGroup",
                                 "when": "!editorFocus" },
  { "key": "ctrl+`",          "command": "workbench.action.terminal.focus",
                                 "when": "!terminalFocus" },
  { "key": "ctrl+shift+q",    "command": "workbench.action.toggleMaximizedPanel" },

@thomasbtatum
Copy link

Just updated everything today and saw this feature is still missing. +1 ! 🙏

@TylerLeonhardt
Copy link
Member

Soon ™ 😉

The PSReadLine PR is almost done.

@MalcolmTyler
Copy link

Any ETA yet on this bug fix being released?

@msevastian
Copy link

Struggling from the same problem since started to use VS Code for Powershell coding :( Up arrow just doesn't populate any last command entered in debugger. Guys any news when it can be fixed?

@rjmholt
Copy link
Contributor

rjmholt commented Sep 6, 2018

There's a preview build available to address this that you can find here: #535 (comment)

Please give it a try -- it's a pretty significant feature, so if you hit any problems please open an issue :)

@sba923
Copy link

sba923 commented Oct 2, 2018

I'm running 1.9.0 on VScode 1.27.2 (Windows, PowerShell 5.1), and still no history when debugging...

Am I missing something?

P.S. I do have the "PSReadLine" feature flag set.

@SeeminglyScience
Copy link
Collaborator

@sba923 Yeah, it's in the 2.0 which isn't released yet. There's a preview build in this comment if you'd like to help test though 🙂

@sba923
Copy link

sba923 commented Oct 2, 2018

IIRC I tried that vsix when it was announced in this thread, but it didn't work, and someone commented it can't work with PowerShell 5.1, only with PowerShell 6.x. Do you concur?

@rjmholt
Copy link
Contributor

rjmholt commented Oct 2, 2018

The latest build in that comment thread works with Windows PowerShell. There is still an extension command bug in it which is fixed upstream, but we're currently getting all the fixes in 1.9.0 into 2.0.0 so we can get an up-to-date AppVeyor build going — that way you won't need to pull from a comment.

@Sharken03
Copy link

With the PSReadline integration done in PowerShell/PowerShellEditorServices#672, i really hope version 2.0 is out soon as it is a really great improvement to VS Code.

@SydneyhSmith
Copy link
Collaborator

Closing as PSReadLine is now available in the PowerShell Preview extension, tracking that PSReadLine is not available in the main PowerShell Extension here #1793

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests