Skip to content

Pushing twice F8 leads to crash in console #1202

Closed

Description

@Schwanowski

Hi there

i am using Visual Studio Code 1.41 Insider edition with Powerhell V7 latest preview and have a very strange issue.

Everything looks stable but when I try to press twice F8 to debug my scripts my console crashs entirely.

Its not related to code because when i reverse to ps ise and v5 all runs perfectly fine.

Can you please advice?

Environment data

Steps to reproduce or exception report

grafik

[Crash.txt]

Crash.txt

Activity

  1. msftrncs commented on Nov 23, 2019

    @msftrncs
    Collaborator

    I am pretty sure this is the same as #1083, and there is no perfect solution for it yet. It happens because the history item that you are reaching with F8 is too long for the buffer in VS Code, and PSReadLine, when it tries to display it to you, it expects to put the cursor on the first line at the end of the matching text, the same as CTRL+r (or + s), but that position is not accessible from VS Code's console.

  2. Schwanowski commented on Nov 23, 2019

    @Schwanowski
    Author
  3. Schwanowski commented on Nov 23, 2019

    @Schwanowski
    Author

    I could fix it on my machine be uninstalling the powershell plugins and re-install them again.

    Unforunately, I was not able to reproduce the issue. It seems be to related to

    • a long code in the history ran by f8
    • maybe a braket } error in the code
  4. msftrncs commented on Nov 25, 2019

    @msftrncs
    Collaborator

    Any history item longer than your VS Code buffer (in lines), should cause the problem, when you use history search commands. This is different than UpArrow or DownArrow, as those always put the cursor on the last line. The search functions will try to place the cursor after the match, and if that match is off the buffer in VS Code, the exception occurs.

    You can also erase your history, note its location is given in `Get-PSReadLineOption'. You could delete the file or edit the file to remove entries.

  5. Schwanowski commented on Nov 26, 2019

    @Schwanowski
    Author

    ok thank you I will figure it out

  6. daxian-dbw commented on Nov 27, 2019

    @daxian-dbw
    Member

    Close as a duplicate of #1083

  7. msftrncs commented on Nov 28, 2019

    @msftrncs
    Collaborator

    Schwanowski, you might want to look at the Set-PSReadLineOption parameter -HistorySearchCursorMovesToEnd. It may be a workaround for this issue, but not sure it will apply to #1083.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-DuplicateThere's another issue on the tracker that's pretty much the same thing.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions