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

Command prompt has unpredictable cursor location while debugging #698

Closed
codearoo opened this issue Apr 26, 2017 · 2 comments
Closed

Command prompt has unpredictable cursor location while debugging #698

codearoo opened this issue Apr 26, 2017 · 2 comments

Comments

@codearoo
Copy link

  • VSCode Version: Code 1.11.2 (6eaebe3b9c70406d67c97779468c324a7a95db0e, 2017-04-13T08:03:11.395Z)
  • OS Version: Windows_NT ia32 10.0.10586
  • Extensions:
Extension Author Version
python donjayamanne 0.6.0
tslint eg2 0.11.0
odoo-snippets jeffery9 0.2.5
MagicPython magicstack 1.0.9
csharp ms-vscode 1.8.1
PowerShell ms-vscode 0.12.2
debugger-for-chrome msjsdiag 2.7.2
python tht13 0.2.3

Steps to Reproduce:

  1. Debug any Powershell script and then say it prompts you for input, or it has a mandatory parameter. When you type of paste text initially it goes crazy by almost sending an Enter after each letter, and it ends up just being stuck there.

Here's how it looks on my screen:
c

                             d

Here's my typing the word "clear":

[DBG]: PS C:\xx> c
[DBG]: PS C:\xx>
[DBG]: PS C:\xx> l
[DBG]: PS C:\xx>
[DBG]: PS C:\xx> e
[DBG]: PS C:\xx>
[DBG]: PS C:\xx> a
[DBG]: PS C:\xx>
[DBG]: PS C:\x> r

So I killed the Terminal and restarted it and it's working normally now. But I have seen it flip back and forth between working and not.

it's messed up again. Basically after running my script. I'm not taking any input in the script itself.. I happen to be running git commands. I'll experiment a bit to see if it has anything to do with the contents of the script.

OK.. it seems to have to do with Debugging and stepping into the code, and once it starts calling a function I guess. I was stepping in and typing "get-date" in the Terminal window and once it stepped into a function I made, it got nutty like this:

[DBG]: PS C:>
[DBG]: PS C:> g
we are testing VS Powershell terminal. You entered c:\test.
[DBG]: PS C:>
[DBG]: PS C:> e
[DBG]: PS C:>
[DBG]: PS C:> t
[DBG]: PS C:> g
This is more output: do something
[DBG]: PS C:> et-date

Code:
`param (
[Parameter(Mandatory = $true)] [string] $folder,
[switch] $pushRemotely = $false
)

function something()
{
return "do something"
}

Write-Host "we are testing VS Powershell terminal. You entered $($folder)."
Write-Host "This is more output: $( something )"
Write-Host "At some point while debugging the PowerShell terminal starts going nuts when inputting anything."

`

@gerane
Copy link

gerane commented May 9, 2017

I've seen this, it skips a letter. One goes to terminal and the next goes to the text input. I can't remember if I filled an issue for pses for this or not.

@gerane
Copy link

gerane commented May 9, 2017

Forgot to add, when I've seen it is when using editor commands in the integrated terminal. It likely was the save if just using prompt for choice as well.

@daviwil daviwil changed the title Powershell Terminal gets really messed up when accepting input Input prompts have unpredictable cursor location while debugging May 9, 2017
@daviwil daviwil added this to the May 2017 milestone May 9, 2017
@daviwil daviwil changed the title Input prompts have unpredictable cursor location while debugging Input and command prompts have unpredictable cursor location while debugging May 9, 2017
@daviwil daviwil changed the title Input and command prompts have unpredictable cursor location while debugging Command prompt has unpredictable cursor location while debugging May 9, 2017
daviwil added a commit to daviwil/PowerShellEditorServices that referenced this issue May 9, 2017
This change fixes an issue which causes the user's cursor location to
jump around when they type the first letter after stepping through code
or hitting multiple breakpoints sequentially.  This is caused by a
hanging input listener which wasn't respecting the cancellation of its
task when it gets evaluated.

Fixes PowerShell/vscode-powershell#698.
@daviwil daviwil modified the milestones: May 2017, 1.0.0-beta1, 1.0.0 May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants