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

Type Ahead isn't "on" for cursor movement when using PowerShell on non-Windows #113853

Closed
TylerLeonhardt opened this issue Jan 5, 2021 · 6 comments · Fixed by #113850
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders macos Issues with VS Code on MAC/OS X verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@TylerLeonhardt
Copy link
Member

Version: 1.53.0-insider
Commit: 4a875e2
Date: 2020-12-21T12:32:43.927Z
Electron: 11.1.0
Chrome: 87.0.4280.88
Node.js: 12.18.3
V8: 8.7.220.29-electron.0
OS: Darwin x64 20.2.0

This seems to be because right arrow in PowerShell on non-Windows emits \x1bOC instead of what the ANSI spec says which is \x1b[C.

Does this issue occur when all extensions are disabled?: Yes

@TylerLeonhardt TylerLeonhardt self-assigned this Jan 5, 2021
@Tyriar Tyriar added this to the January 2021 milestone Jan 6, 2021
@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug macos Issues with VS Code on MAC/OS X labels Jan 6, 2021
@JacksonKearl
Copy link
Contributor

Steps to verify?

@JacksonKearl JacksonKearl added the verification-steps-needed Steps to verify are needed for verification label Jan 28, 2021
@TylerLeonhardt
Copy link
Member Author

It'll be easiest to see this in Codespaces or Remote probably (or throttle the CPU via dev tools maybe):

You should see characters start grey and then become colorized. This is the work of typeahead.

@TylerLeonhardt TylerLeonhardt added verification-needed Verification of issue is requested and removed verification-steps-needed Steps to verify are needed for verification labels Jan 28, 2021
@JacksonKearl
Copy link
Contributor

JacksonKearl commented Jan 28, 2021

I should have said what does "on" for cursor movement mean in the context of TypeAhead?

@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Jan 28, 2021

This would be transparent to the end user, unfortunately. The true test is verifying that when you use the left or right arrow key that this code block gets hit:

const direction = cursorMv[3] as CursorMoveDirection;
const p = new CursorMovePrediction(direction, !!cursorMv[2], Number(cursorMv[1]) || 1);
if (direction === CursorMoveDirection.Back) {
addLeftNavigating(p);
} else {
addRightNavigating(p);
}
continue;

before my 1 character change, it did not hit that block.

@TylerLeonhardt
Copy link
Member Author

ok I think ive got a valid test...

  1. Open the vscode repo in Codespaces
  2. launch pwsh
  3. type asdf asd fasdf asd fasd fas dfsd afsdf a sadfsadf a sdfaf sdsaf dsadf to fill the prompt a bit
  4. Hit left arrow a few times to be in the middle of that ^
  5. do: Ctrl+LeftArrow a few times

TypeAhead assumes that Ctrl+LeftArrow moves the cursor by a word (tbh this is a bad assumption... but since 95% of the time Codespaces will use bash or zsh... it's slightly less bad of an assumption I guess)
PowerShell doesn't use Ctrl+LeftArrow to move back a word so what you see is:

TypeAhead guesses by moving the cursor back a word
PowerShell responds saying "the cursor didn't go anywhere"
TypeAhead's prediction is reverted and the cursor goes back to where it was

@TylerLeonhardt
Copy link
Member Author

If TypeAhead was off, by doing:

"terminal.integrated.localEchoLatencyThreshold": -1

The word jump wouldn't happen at all

@JacksonKearl JacksonKearl added the verified Verification succeeded label Jan 29, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders macos Issues with VS Code on MAC/OS X verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@Tyriar @TylerLeonhardt @JacksonKearl and others