Skip to content

Using CTRL+C can cause break of debugging #1581

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
PrzemyslawKlys opened this issue Oct 14, 2018 · 10 comments
Closed

Using CTRL+C can cause break of debugging #1581

PrzemyslawKlys opened this issue Oct 14, 2018 · 10 comments
Labels

Comments

@PrzemyslawKlys
Copy link
Contributor

I've been working with VSCode for a while and I often catch myself on pressing F5, noticing an error and I press CTRL+C multiple times to quickly terminate. I noticed that sometimes VS Code will come back from this but in a broken state where pressing F5 doesn't do anything anymore. This may or may not be related to me pressing it during Formatting on Save but maybe overall canceling running may impact how VSCode processes it. Of course maybe I shouldn't cancel things like I do .. but well.. trigger happy it is.

@SeeminglyScience
Copy link
Collaborator

I fixed a good bit of the circumstances that can land VSCode in that state as part of the 2.0 PSReadLine integration.

If you're able to test if you can reproduce it with 2.0 that would be greatly appreciate. I'm not actually sure where the link is to the latest preview build though as it was taken out of the build script. Summoning @rjmholt

@PrzemyslawKlys
Copy link
Contributor Author

Sure. Let me know where I can get it and I'll install it.

@rjmholt
Copy link
Contributor

rjmholt commented Oct 16, 2018

v2 preview build

@rjmholt rjmholt added the Issue-Bug A bug to squash. label Oct 16, 2018
@PrzemyslawKlys
Copy link
Contributor Author

10/18/2018 10:01:59 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:01:59 AM [VERBOSE] - Document formatting finished in 0.212s
10/18/2018 10:02:44 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:02:44 AM [VERBOSE] - Document formatting finished in 0.091s
10/18/2018 10:04:31 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:04:31 AM [VERBOSE] - Document formatting finished in 0.091s
10/18/2018 10:05:04 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:05:04 AM [VERBOSE] - Document formatting finished in 0.09s
10/18/2018 10:05:17 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:05:17 AM [VERBOSE] - Document formatting finished in 0.069s
10/18/2018 10:05:22 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:05:42 AM [VERBOSE] - Document formatting finished in 20.186s
10/18/2018 10:06:46 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:06:46 AM [VERBOSE] - Document formatting finished in 0.069s
10/18/2018 10:07:04 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:07:04 AM [VERBOSE] - Document formatting finished in 0.067s
10/18/2018 10:07:10 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:07:10 AM [VERBOSE] - Document formatting finished in 0.075s
10/18/2018 10:07:17 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:07:17 AM [VERBOSE] - Document formatting finished in 0.138s
10/18/2018 10:07:29 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:07:30 AM [VERBOSE] - Document formatting finished in 0.07s
10/18/2018 10:07:48 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:07:48 AM [VERBOSE] - Document formatting finished in 0.063s
10/18/2018 10:08:06 AM [VERBOSE] - Formatting entire document - file:///c%3A/Support/GitHub/PSMigrator/Paccor-Login/Fix-Licenses.ps1...
10/18/2018 10:08:18 AM [VERBOSE] - Document formatting finished in 12.018s
10/18/2018 10:09:46 AM [NORMAL] - Shutting down language client...
10/18/2018 10:09:46 AM [NORMAL] - Terminating PowerShell process...

With preview v2. After I waited for 12 seconds and saw format on save stop.. F5 didn't work anymore. I waited a bit more and then killed powershell session. I also noticed that you can't cancel with CTRL+C some stuff. Like if it's in the middle of connecting to Office 365 until it's done you can't cancel it.

1539849704-9b8c7aca-47f9-4efe-b943-0074efcbaa0a1539758352166.zip

I've did some edits of the log to remove/replace some data. I guess I should write PowerShell nulling script that would remove sensitive information :) Hopefully i've not broken logs.

@rjmholt
Copy link
Contributor

rjmholt commented Oct 18, 2018

@PrzemyslawKlys if you take a normal PowerShell console session, can you cancel connecting to office365 in the middle of things? Or is it just faster?

Ctrl+C can only cancel when PowerShell gets the opportunity to. So if it's a .NET call, or there's some thread scheduling to wait on, it can't work. I suspect it might be the latter case here.

@PrzemyslawKlys
Copy link
Contributor Author

Will test this out. As additional note I seem to be hitting this formatting issue more and more in latest releases (maybe related to updates to VSCode in some way. Or maybe I'm working on projects with more files in it. The problem is that I can edit 2 lines in a file, press save (nothing really changed) and I can see formatter takes 5-12 seconds to fix things.

image

Masybe it's just amount of files it tries to scan. Maybe I should disable format on save feature and try to bind some key to format when really needed. I do like this feature thou :/

@rjmholt
Copy link
Contributor

rjmholt commented Oct 19, 2018

As it happens, I got a chance to test a long running .NET API call today. Ctrl+C does not work in the ordinary PowerShell console for that.

I suppose SIGINT handling is something most .NET libraries don't do...

@PrzemyslawKlys
Copy link
Contributor Author

Makes sense. Thanks for checking it out.

@PrzemyslawKlys
Copy link
Contributor Author

I am wondering.. at some point (on my request) you guys implemented a safety to not be able to start script if PowerShell isn't ready or so.

#1433

Now could this be a problem now with the F5 not responding? Just had this case where I started VSCode, pressed F5 it wasn't ready and subsequent tried even after it gets ready do nothing.

Maybe it kind of shows up magically in other instances?

@PrzemyslawKlys
Copy link
Contributor Author

Also I see the issue with showing .json was solved in VSCode? Maybe this affects how things work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants