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

Narrator scan mode crashes terminal #6402

Closed
binyomen opened this issue Jun 7, 2020 · 4 comments · Fixed by #6447
Closed

Narrator scan mode crashes terminal #6402

binyomen opened this issue Jun 7, 2020 · 4 comments · Fixed by #6447
Assignees
Labels
Area-Accessibility Issues related to accessibility Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-Crash Crashes are real bad news.
Milestone

Comments

@binyomen
Copy link

binyomen commented Jun 7, 2020

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.836]
Windows Terminal version (if applicable): 1.0.1401.0

Any other software?: Narrator, the version which comes with this windows build

Steps to reproduce

  • Start Narrator using Win+Ctrl+Enter
  • Open the Windows Terminal app
    • Make sure the Narrator cursor (blue box) is on the terminal cursor, and/or that Narrator says "editing" as part of the information when you navigate to the terminal window (if Narrator is not focused on the correct place in the terminal window, alt-tabbing away and back should fix it).
  • Activate scan mode with Caps+Space (Narrator will say "scan")
  • Press the down arrow key (Narrator will say "title bar")
    • If Narrator does not announce "title bar", it may be further down in the UI tree. Keep pressing the down arrow until you reach it
  • Press the up arrow key, and the Windows Terminal app crashes

Expected behavior

I would expect the terminal app not to crash, and for Narrator focus to return to the edit box.

Actual behavior

The terminal app crashes.

Feedback hub link

https://aka.ms/AA8mlsm

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jun 7, 2020
@binyomen
Copy link
Author

binyomen commented Jun 7, 2020

It's also worth noting that this doesn't repro using non-scan mode commands. Navigating away from the "title bar" element with Caps+left arrow instead of just up arrow does not crash the app.

Some other scan mode navigation commands seem to have the same effect. If at the "title bar" element you press left arrow instead of up arrow, you are returned to the edit pane (specifically a space in the bottom right corner of the edit pane). If you then press right arrow, however, the app crashes as well.

@zadjii-msft zadjii-msft added Area-Accessibility Issues related to accessibility Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news. labels Jun 9, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 9, 2020
@zadjii-msft zadjii-msft added this to the Terminal v2.0 milestone Jun 9, 2020
@ghost ghost added the In-PR This issue has a related PR label Jun 9, 2020
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jun 10, 2020
@ghost ghost closed this as completed in #6447 Jul 20, 2020
@ghost ghost removed the In-PR This issue has a related PR label Jul 20, 2020
ghost pushed a commit that referenced this issue Jul 20, 2020
In UiaTextRange, `_getBufferSize` returns an optimized version of the
size of the buffer to be the origin and the last character in the
buffer. This is to improve performance on search or checking if you are
currently on the last word/line.

When setting the endpoint and drawing the bounding rectangles, we should
be retrieving the true buffer size. This is because it is still possible
to create UiaTextRanges that are outside of this optimized size. The
main source of this is `ExpandToEnclosingUnit()` when the unit is
`Document`. The end _should_ be the last visible character, but it isn't
because that would break our tests.

This is an incomplete solution. #6986 is a follow up to completely test
and implement the solution.

The crash in #6402 was caused by getting the document range (a range of
the full text buffer),  then moving the end by one character. When we
get the document range, we get the optimized size of the buffer (the
position of the last character). Moving by one character is valid
because the buffer still has more to explore. We then crash from
checking if the new position is valid on the **optimized size**, not the
**real size**.

REFERENCES

#6986 - follow up to properly handle/test this "end of buffer" problem

Closes #6402
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Jul 20, 2020
DHowett pushed a commit that referenced this issue Jul 20, 2020
In UiaTextRange, `_getBufferSize` returns an optimized version of the
size of the buffer to be the origin and the last character in the
buffer. This is to improve performance on search or checking if you are
currently on the last word/line.

When setting the endpoint and drawing the bounding rectangles, we should
be retrieving the true buffer size. This is because it is still possible
to create UiaTextRanges that are outside of this optimized size. The
main source of this is `ExpandToEnclosingUnit()` when the unit is
`Document`. The end _should_ be the last visible character, but it isn't
because that would break our tests.

This is an incomplete solution. #6986 is a follow up to completely test
and implement the solution.

The crash in #6402 was caused by getting the document range (a range of
the full text buffer),  then moving the end by one character. When we
get the document range, we get the optimized size of the buffer (the
position of the last character). Moving by one character is valid
because the buffer still has more to explore. We then crash from
checking if the new position is valid on the **optimized size**, not the
**real size**.

REFERENCES

#6986 - follow up to properly handle/test this "end of buffer" problem

Closes #6402

(cherry picked from commit c390b61)
DHowett pushed a commit that referenced this issue Jul 20, 2020
In UiaTextRange, `_getBufferSize` returns an optimized version of the
size of the buffer to be the origin and the last character in the
buffer. This is to improve performance on search or checking if you are
currently on the last word/line.

When setting the endpoint and drawing the bounding rectangles, we should
be retrieving the true buffer size. This is because it is still possible
to create UiaTextRanges that are outside of this optimized size. The
main source of this is `ExpandToEnclosingUnit()` when the unit is
`Document`. The end _should_ be the last visible character, but it isn't
because that would break our tests.

This is an incomplete solution. #6986 is a follow up to completely test
and implement the solution.

The crash in #6402 was caused by getting the document range (a range of
the full text buffer),  then moving the end by one character. When we
get the document range, we get the optimized size of the buffer (the
position of the last character). Moving by one character is valid
because the buffer still has more to explore. We then crash from
checking if the new position is valid on the **optimized size**, not the
**real size**.

REFERENCES

#6986 - follow up to properly handle/test this "end of buffer" problem

Closes #6402

(cherry picked from commit c390b61)
@ghost
Copy link

ghost commented Jul 21, 2020

🎉This issue was addressed in #6447, which has now been successfully released as Windows Terminal v1.1.2021.0.:tada:

Handy links:

1 similar comment
@ghost
Copy link

ghost commented Jul 22, 2020

🎉This issue was addressed in #6447, which has now been successfully released as Windows Terminal v1.1.2021.0.:tada:

Handy links:

@ghost
Copy link

ghost commented Jul 22, 2020

🎉This issue was addressed in #6447, which has now been successfully released as Windows Terminal Preview v1.2.2022.0.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Accessibility Issues related to accessibility Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-Crash Crashes are real bad news.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants