Skip to content

Pushing twice F8 leads to crash in console #1202

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

Closed
Schwanowski opened this issue Nov 22, 2019 · 7 comments
Closed

Pushing twice F8 leads to crash in console #1202

Schwanowski opened this issue Nov 22, 2019 · 7 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@Schwanowski
Copy link

Schwanowski commented Nov 22, 2019

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

@msftrncs
Copy link
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.

@Schwanowski
Copy link
Author

Schwanowski commented Nov 23, 2019 via email

@Schwanowski
Copy link
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

@msftrncs
Copy link
Collaborator

msftrncs commented Nov 25, 2019

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.

@Schwanowski
Copy link
Author

ok thank you I will figure it out

@daxian-dbw daxian-dbw added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Nov 27, 2019
@daxian-dbw
Copy link
Member

Close as a duplicate of #1083

@msftrncs
Copy link
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
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants