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

Fix textarea sync edge cases #197025

Merged
merged 1 commit into from
Oct 30, 2023
Merged

Fix textarea sync edge cases #197025

merged 1 commit into from
Oct 30, 2023

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Oct 30, 2023

  • PowerShell is now handled with a specific regex which has an optional space at the end, if matched a space will be added to the end. This is needed because conpty may not 'render' the final space in the prompt.
  • Return true in _cursorOnNextLine check if there is a single command as this means it's the first command, so any match should be correct.
  • Increase polling to 1000ms (50x20ms) as it was being hit on my machine.

Fixes #196758

Recording 2023-10-30 at 12 53 22

- PowerShell is now handled with a specific regex which has an optional
  space at the end, if matched a space will be added to the end. This is
  needed because conpty may not 'render' the final space in the prompt.
- Return true in _cursorOnNextLine check if there is a single command as
  this means it's the first command, so any match should be correct.
- Increase polling to 1000ms (50x20ms) as it was being hit on my machine.

Fixes #196758
@Tyriar Tyriar added this to the November 2023 milestone Oct 30, 2023
@Tyriar Tyriar self-assigned this Oct 30, 2023
@Tyriar Tyriar enabled auto-merge October 30, 2023 19:56
@@ -442,8 +444,26 @@ export class CommandDetectionCapability extends Disposable implements ICommandDe
if (!line) {
return;
}
// TODO: fine tune prompt regex to accomodate for unique configurtions.
return line.translateToString(true)?.match(/^(?<prompt>(\(.+\)\s)?(?:PS.+>\s)|(?:[A-Z]:\\.*>))/)?.groups?.prompt;
// TODO: fine tune prompt regex to accomodate for unique configurations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could move this down to where it's relevant.

@Tyriar Tyriar merged commit 9795b10 into main Oct 30, 2023
7 checks passed
@Tyriar Tyriar deleted the tyriar/196758 branch October 30, 2023 20:34
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terminal textbox cursor is not in correct position when unfocusing and focusing again
2 participants