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

History through up and down arrow in Debugger is not available #975

Closed
Stephanevg opened this issue Jul 25, 2017 · 8 comments
Closed

History through up and down arrow in Debugger is not available #975

Stephanevg opened this issue Jul 25, 2017 · 8 comments
Labels
Area-Extension Terminal Issue-Enhancement A feature request (enhancement).

Comments

@Stephanevg
Copy link

Stephanevg commented Jul 25, 2017

Hi guys, I hope everybody is well ^^

For any Powershell script that I open in VScode, when I set a break point, and launch the script, VS code will stop at that breakpoint.

Once stopped, I then have the possibility to launch several commands in the interactive shell beneath the scripting pane. I can have a look into variables, launch various powershell commands, my loaded functions without any issue.

If I want to recall a command that I typed earlier, by pressing the up or down arrow nothing happens. I need to retype the complete command if I want to call the same command twice.

Reproduction Steps:

  1. Create a script called Test.ps1

  2. Add a few random commands in it:
    Get-Command
    Get-Random
    Get-Module
    Get-Service

  3. Set a break point on Get-Random for example, and call the script

  4. In the debugger type get-process, get-history,get-random

  5. Try to use the up or down arrow to get to the previous typed commands (this is what is not working).

VScode version:

image

PSExention version --> 1.4.1

System Details

  • Operating system name and version: seen on Windows 10 (psv 5.0) and Windows Server 2012 R2 (ps v 5.1)
  • VS Code version: 5.0 and 5.1
  • PowerShell extension version:
  • Output from $PSVersionTable:
    See below

$pseditor.EditorServicesVersion

1.14.1
2648980a697a4c8fb5777dcfb2ab110cec8a2f58

code --list-extensions --show-versions
[email protected]

$PSVersionTable
$PsVersionTable:


Name                           Value                                                                                                                                                                              
----                           -----                                                                                                                                                                              
PSVersion                      5.1.14407.1003                                                                                                                                                                     
PSEdition                      Desktop                                                                                                                                                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                            
BuildVersion                   10.0.14407.1003                                                                                                                                                                    
CLRVersion                     4.0.30319.42000                                                                                                                                                                    
WSManStackVersion              3.0                                                                                                                                                                                
PSRemotingProtocolVersion      2.3                                                                                                                                                                                
SerializationVersion           1.1.0.1                                                                                                                                                                            


(But this behaviour is identicall on a machine with ps 5.0)

Thanks in advance guys! :)
@Stephanevg Stephanevg changed the title History in Debugger is not available History through up and down arrow in Debugger is not available Jul 25, 2017
@rkeithhill
Copy link
Contributor

This should be coming with the introduction of PSReadline support. Tracked in issue #535.

@rkeithhill rkeithhill added Area-Extension Terminal Issue-Enhancement A feature request (enhancement). labels Jul 25, 2017
@Stephanevg
Copy link
Author

Ok great! Looking forward to it!

@daviwil
Copy link
Contributor

daviwil commented Aug 14, 2017

Yep, closing this issue in favor of the other one.

@Stephanevg
Copy link
Author

Hi, I would like to reopen this issue, as I have the feeling that the fix you are preparing (thread here #535 and #1310 ) will come only with the drop of support of PS 3 and 4.

As a matter a fact, this is the only (but the most painfull) issue I have with Vscode, and I would really like to have this one solved.

@TylerLeonhardt
Copy link
Member

@Stephanevg, this was the intended plan since PSReadLine will require dropping 3 and 4. Is this not suitable for you?

@Stephanevg
Copy link
Author

@tylerl0706 This means that VScode must run a Ps versions 5 and above, right? If that is the case, then I am ok with this resolution.
If this means that scripts that targets PSversion 3/4 (using the #require statement for example) won't be able to use this fix, then no.

@joeyaiello
Copy link

@Stephanevg: if you have Windows PS 5 installed on your machine, #require -version with 3.0 or 4.0 will run in Windows PS 5, as it's impossible to have any combination of 3, 4, and 5 installed simultaneously on the same machine. (The exception here is Windows PowerShell 2.0 which can be installed side-by-side with 3, 4, or 5 because it uses a distinct .NET Framework from the others.) Many folks erroneously believe that powershell.exe -version 3 will open 3.0 on their 5.0 machine, but it silently just launches 5.

So in short: if you don't have 5 installed on your machine, this will continue to fail after we move to PSReadline. If you do have 5 installed, #require will have no effect (it's just there to block executions on machines where 2.0 is the highest available version).

@rjmholt
Copy link
Contributor

rjmholt commented Sep 13, 2018

I've built a new preview of the v2 extension that you can find here: #535 (comment).

Also, on the #require point, it's worth noting that -Version refers to the minimum version of PowerShell required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extension Terminal Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

6 participants